From 818742dd5653cde44404c65b3062af789c874cb5 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Mon, 28 Aug 2017 11:20:24 +0200 Subject: [PATCH 1/3] Add frame-src for IE/Edge compatibility --- config.example.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.example.js b/config.example.js index 1b28a5e89..ce38b5c3a 100644 --- a/config.example.js +++ b/config.example.js @@ -35,6 +35,8 @@ module.exports = { * domain which will serve your CryptPad instance. */ "child-src blob: *", + // IE/Edge + "frame-src blob: *", "media-src * blob:", @@ -62,7 +64,9 @@ module.exports = { /* See above under 'contentSecurity' as to how these values should be * configured for best effect. */ - "child-src *", + "child-src *", + // IE/Edge + "frame-src *", // see the comment above in the 'contentSecurity' section "connect-src 'self' ws: wss:" + domain, From abec07b1f9ae7bf660146cf3d21949788b5889b2 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Mon, 28 Aug 2017 11:21:01 +0200 Subject: [PATCH 2/3] If config.js is missing, fallback to config.example.js which is in the git repo --- server.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index faab366f6..baf9b2e99 100644 --- a/server.js +++ b/server.js @@ -10,7 +10,13 @@ var NetfluxSrv = require('./node_modules/chainpad-server/NetfluxWebsocketSrv'); var Package = require('./package.json'); var Path = require("path"); -var config = require('./config'); +var config; +try { + config = require('./config'); +} catch (e) { + console.log("You can customize the configuration by copying config.example.js to config.js"); + config = require('./config.example'); +} var websocketPort = config.websocketPort || config.httpPort; var useSecureWebsockets = config.useSecureWebsockets || false; From e62faf7c7b544020c185ccf04d2cca8e4ee52fe2 Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Mon, 28 Aug 2017 11:22:57 +0200 Subject: [PATCH 3/3] Edge fix, always use async iframe onLoad rather than invoking it manually --- www/pad2/wysiwygarea-plugin.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/www/pad2/wysiwygarea-plugin.js b/www/pad2/wysiwygarea-plugin.js index c7f827000..7a0d08788 100644 --- a/www/pad2/wysiwygarea-plugin.js +++ b/www/pad2/wysiwygarea-plugin.js @@ -55,7 +55,12 @@ define(['/api/config'], function (ApiConfig) { // Asynchronous iframe loading is only required in IE>8 and Gecko (other reasons probably). // Do not use it on WebKit as it'll break the browser-back navigation. - var useOnloadEvent = ( CKEDITOR.env.ie && !CKEDITOR.env.edge ) || CKEDITOR.env.gecko; + var useOnloadEvent = ( CKEDITOR.env.ie && !CKEDITOR.env.edge ) || CKEDITOR.env.gecko; + + // CryptPad + // This breaks Edge so lets use async all of the time + useOnloadEvent = true; + if ( useOnloadEvent ) iframe.on( 'load', onLoad );