From b1f2d287b41ed66eecf263060de1bee6236bba8c Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 28 Aug 2018 17:44:15 +0200 Subject: [PATCH] Add warning for chrome 68 users on Mac --- customize.dist/translations/messages.js | 1 + www/common/sframe-common-outer.js | 18 ++++++++++++++++++ www/common/sframe-common.js | 4 ++++ www/common/sframe-protocol.js | 3 +++ 4 files changed, 26 insertions(+) diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index f29290bff..8e57a665e 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -1226,5 +1226,6 @@ define(function () { out.sharedFolders_create_password = "Folder password"; out.sharedFolders_share = "Share this URL with other registered users to give them access to the shared folder. Once they open this URL, the shared folder will be added to the root directory of their CryptDrive."; + out.chrome68 = "It seems that you're using the browser Chrome or Chromium version 68. It contains a bug resulting in the page turning completely white after a few seconds or the page being unresponsive to clicks. To fix this issue, you can switch to another tab and come back, or try to scroll in the page. This bug should be fixed in the next version of your browser."; return out; }); diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 0761f1034..097d0eeb2 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -749,6 +749,24 @@ define([ }); } + // Chrome 68 on Mac contains a bug resulting in the page turning white after a few seconds + try { + if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 && + !localStorage.CryptPad_chrome68) { + var isChrome = !!window.chrome && !!window.chrome.webstore; + var getChromeVersion = function () { + var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); + return raw ? parseInt(raw[2], 10) : false; + }; + if (isChrome && getChromeVersion() === 68) { + sframeChan.whenReg('EV_CHROME_68', function () { + sframeChan.event("EV_CHROME_68"); + localStorage.CryptPad_chrome68 = "1"; + }); + } + } + } catch (e) {} + // Join the netflux channel diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index 8331e5f60..8452b57e3 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -484,6 +484,10 @@ define([ }); }); + ctx.sframeChan.on('EV_CHROME_68', function () { + UI.alert(Messages.chrome68); + }); + ctx.sframeChan.ready(); cb(funcs); }); diff --git a/www/common/sframe-protocol.js b/www/common/sframe-protocol.js index fbe311ba8..74fef60d5 100644 --- a/www/common/sframe-protocol.js +++ b/www/common/sframe-protocol.js @@ -251,6 +251,9 @@ define({ // Critical error outside the iframe during loading screen 'EV_LOADING_ERROR': true, + // Chrome 68 bug... + 'EV_CHROME_68': true, + // Get all existing tags 'Q_GET_ALL_TAGS': true,