From e1298e4fd96bae86af23194c6fba50ba3dca4ca4 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Thu, 24 May 2018 19:00:07 +0200 Subject: [PATCH 1/6] Fix Touch issues on IOS Safari (iPad) --- views/embed/stream.njk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/views/embed/stream.njk b/views/embed/stream.njk index ddc620f8e..d6c53b210 100644 --- a/views/embed/stream.njk +++ b/views/embed/stream.njk @@ -9,6 +9,13 @@ {% block html %}
+ +{# + Resolves touch handling issues encountered on IOS Safari under certain circumstances + https://www.pivotaltracker.com/n/projects/1863625 +#} + + {% endblock %} {% block js %} From 7d861236b8b4ab578456b1a2f34e59412b131445 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 25 May 2018 11:21:53 -0600 Subject: [PATCH 2/6] disable CSP until we can work on configuration + webpack issues --- docs/source/02-02-advanced-configuration.md | 5 +++-- routes/index.js | 4 ++-- routes/plugins.js | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/02-02-advanced-configuration.md b/docs/source/02-02-advanced-configuration.md index 13ad2c35a..451865e47 100644 --- a/docs/source/02-02-advanced-configuration.md +++ b/docs/source/02-02-advanced-configuration.md @@ -512,13 +512,14 @@ tracing of GraphQL requests. **Note: Apollo Engine is a premium service, charges may apply.** -## TALK_ENABLE_STRICT_CSP + + ## ALLOW_NO_LIMIT_QUERIES diff --git a/routes/index.js b/routes/index.js index 5183e2881..cb8e03b33 100644 --- a/routes/index.js +++ b/routes/index.js @@ -9,7 +9,6 @@ const path = require('path'); const compression = require('compression'); const plugins = require('../services/plugins'); const staticTemplate = require('../middleware/staticTemplate'); -const contentSecurityPolicy = require('../middleware/contentSecurityPolicy'); const nonce = require('../middleware/nonce'); const staticServer = require('express-static-gzip'); const { DISABLE_STATIC_SERVER } = require('../config'); @@ -76,7 +75,8 @@ router.use(compression()); // STATIC ROUTES //============================================================================== -const staticMiddleware = [staticTemplate, nonce, contentSecurityPolicy]; +// TODO: re-add CSP once we've resolved issues with dynamic webpack loading. +const staticMiddleware = [staticTemplate, nonce]; router.use('/admin', ...staticMiddleware, require('./admin')); router.use('/account', ...staticMiddleware, require('./account')); diff --git a/routes/plugins.js b/routes/plugins.js index fcc1125b9..8504c0c94 100644 --- a/routes/plugins.js +++ b/routes/plugins.js @@ -2,13 +2,12 @@ const express = require('express'); const debug = require('debug')('talk:routes:plugins'); const plugins = require('../services/plugins'); const staticTemplate = require('../middleware/staticTemplate'); -const contentSecurityPolicy = require('../middleware/contentSecurityPolicy'); const nonce = require('../middleware/nonce'); const router = express.Router(); -// Apply the middleware. -router.use(staticTemplate, nonce, contentSecurityPolicy); +// TODO: re-add CSP once we've resolved issues with dynamic webpack loading. +router.use(staticTemplate, nonce); // Inject server route plugins. plugins.get('server', 'router').forEach(plugin => { From 540df09b5bbe60af48ea4473e0beb750a7399ed9 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 25 May 2018 11:48:55 -0600 Subject: [PATCH 3/6] Update stream.njk --- views/embed/stream.njk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/embed/stream.njk b/views/embed/stream.njk index d6c53b210..8b9cf52b6 100644 --- a/views/embed/stream.njk +++ b/views/embed/stream.njk @@ -11,8 +11,8 @@
{# - Resolves touch handling issues encountered on IOS Safari under certain circumstances - https://www.pivotaltracker.com/n/projects/1863625 + Resolves touch handling issues encountered on IOS Safari under certain circumstances: + https://stackoverflow.com/questions/12363742/touchstart-event-is-not-firing-inside-iframe-ios-6 #} From c1eab3f2c65b46de00daa33f662ffc8322b2e91e Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 25 May 2018 11:51:43 -0600 Subject: [PATCH 4/6] moved event handler to bundle --- client/coral-embed-stream/src/index.js | 5 +++++ views/embed/stream.njk | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/client/coral-embed-stream/src/index.js b/client/coral-embed-stream/src/index.js index a4c6bcd39..1142239c6 100644 --- a/client/coral-embed-stream/src/index.js +++ b/client/coral-embed-stream/src/index.js @@ -8,6 +8,11 @@ import reducers from './reducers'; import TalkProvider from 'coral-framework/components/TalkProvider'; import pluginsConfig from 'pluginsConfig'; +// Resolves touch handling issues encountered on IOS Safari under certain +// circumstances. It may be related to issues reported here: +// https://stackoverflow.com/questions/12363742/touchstart-event-is-not-firing-inside-iframe-ios-6 +document.body.addEventListener('touchstart', () => {}); + async function main() { const context = await createContext({ reducers, diff --git a/views/embed/stream.njk b/views/embed/stream.njk index 8b9cf52b6..ddc620f8e 100644 --- a/views/embed/stream.njk +++ b/views/embed/stream.njk @@ -9,13 +9,6 @@ {% block html %}
- -{# - Resolves touch handling issues encountered on IOS Safari under certain circumstances: - https://stackoverflow.com/questions/12363742/touchstart-event-is-not-firing-inside-iframe-ios-6 -#} - - {% endblock %} {% block js %} From ba2abab3589211aaf6ebec1854147f67ef892670 Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Fri, 25 May 2018 11:54:34 -0600 Subject: [PATCH 5/6] added pivotal tracker ref --- client/coral-embed-stream/src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/coral-embed-stream/src/index.js b/client/coral-embed-stream/src/index.js index 1142239c6..a2718e49d 100644 --- a/client/coral-embed-stream/src/index.js +++ b/client/coral-embed-stream/src/index.js @@ -10,7 +10,10 @@ import pluginsConfig from 'pluginsConfig'; // Resolves touch handling issues encountered on IOS Safari under certain // circumstances. It may be related to issues reported here: -// https://stackoverflow.com/questions/12363742/touchstart-event-is-not-firing-inside-iframe-ios-6 +// +// https://stackoverflow.com/questions/12363742/touchstart-event-is-not-firing-inside-iframe-ios-6 +// +// Further details: https://www.pivotaltracker.com/story/show/157794038 document.body.addEventListener('touchstart', () => {}); async function main() { From cedabf04e305514aaaac709064ae637d47fb3b60 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Fri, 25 May 2018 15:04:00 -0400 Subject: [PATCH 6/6] Bump version to 4.4.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b21e2f78a..2697484c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "talk", - "version": "4.4.1", + "version": "4.4.2", "description": "A better commenting experience from Mozilla, The New York Times, and the Washington Post. https://coralproject.net", "main": "app.js", "private": true,