Open platform to collect and prioritize feedback
enhancement: drop IE11 support (#919)
Guilherme Oenning723cfe1048bf
diff --git a/app/middlewares/security_test.go b/app/middlewares/security_test.goindex 269d4d297..a786f70de 100644--- a/app/middlewares/security_test.go+++ b/app/middlewares/security_test.go@@ -23,7 +23,7 @@ func TestSecureWithoutCDN(t *testing.T) {return c.NoContent(http.StatusOK)})- expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com ; script-src 'self' 'nonce-" + ctxID + "' https://cdn.polyfill.io https://js.stripe.com https://www.google-analytics.com ; img-src 'self' https: data: ; font-src 'self' https://fonts.gstatic.com data: ; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com https://ipinfo.io https://js.stripe.com ; frame-src 'self' https://js.stripe.com"+ expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com ; script-src 'self' 'nonce-" + ctxID + "' https://js.stripe.com https://www.google-analytics.com ; img-src 'self' https: data: ; font-src 'self' https://fonts.gstatic.com data: ; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com https://ipinfo.io https://js.stripe.com ; frame-src 'self' https://js.stripe.com"Expect(status).Equals(http.StatusOK)Expect(response.Header().Get("Content-Security-Policy")).Equals(expectedPolicy)@@ -46,7 +46,7 @@ func TestSecureWithCDN(t *testing.T) {return c.NoContent(http.StatusOK)})- expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com *.test.fider.io; script-src 'self' 'nonce-" + ctxID + "' https://cdn.polyfill.io https://js.stripe.com https://www.google-analytics.com *.test.fider.io; img-src 'self' https: data: *.test.fider.io; font-src 'self' https://fonts.gstatic.com data: *.test.fider.io; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com https://ipinfo.io https://js.stripe.com *.test.fider.io; frame-src 'self' https://js.stripe.com"+ expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com *.test.fider.io; script-src 'self' 'nonce-" + ctxID + "' https://js.stripe.com https://www.google-analytics.com *.test.fider.io; img-src 'self' https: data: *.test.fider.io; font-src 'self' https://fonts.gstatic.com data: *.test.fider.io; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com https://ipinfo.io https://js.stripe.com *.test.fider.io; frame-src 'self' https://js.stripe.com"Expect(status).Equals(http.StatusOK)Expect(response.Header().Get("Content-Security-Policy")).Equals(expectedPolicy)@@ -69,7 +69,7 @@ func TestSecureWithCDN_SingleHost(t *testing.T) {return c.NoContent(http.StatusOK)})- expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com test.fider.io; script-src 'self' 'nonce-" + ctxID + "' https://cdn.polyfill.io https://js.stripe.com https://www.google-analytics.com test.fider.io; img-src 'self' https: data: test.fider.io; font-src 'self' https://fonts.gstatic.com data: test.fider.io; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com https://ipinfo.io https://js.stripe.com test.fider.io; frame-src 'self' https://js.stripe.com"+ expectedPolicy := "base-uri 'self'; default-src 'self'; style-src 'self' 'nonce-" + ctxID + "' https://fonts.googleapis.com test.fider.io; script-src 'self' 'nonce-" + ctxID + "' https://js.stripe.com https://www.google-analytics.com test.fider.io; img-src 'self' https: data: test.fider.io; font-src 'self' https://fonts.gstatic.com data: test.fider.io; object-src 'none'; media-src 'none'; connect-src 'self' https://www.google-analytics.com https://ipinfo.io https://js.stripe.com test.fider.io; frame-src 'self' https://js.stripe.com"Expect(status).Equals(http.StatusOK)Expect(response.Header().Get("Content-Security-Policy")).Equals(expectedPolicy)diff --git a/app/pkg/web/engine.go b/app/pkg/web/engine.goindex 23bf2dca4..b8a7eda8c 100644--- a/app/pkg/web/engine.go+++ b/app/pkg/web/engine.go@@ -27,7 +27,7 @@ var (cspBase = "base-uri 'self'"cspDefault = "default-src 'self'"cspStyle = "style-src 'self' 'nonce-%[1]s' https://fonts.googleapis.com %[2]s"- cspScript = "script-src 'self' 'nonce-%[1]s' https://cdn.polyfill.io https://js.stripe.com https://www.google-analytics.com %[2]s"+ cspScript = "script-src 'self' 'nonce-%[1]s' https://js.stripe.com https://www.google-analytics.com %[2]s"cspFont = "font-src 'self' https://fonts.gstatic.com data: %[2]s"cspImage = "img-src 'self' https: data: %[2]s"cspObject = "object-src 'none'"diff --git a/app/pkg/web/testdata/basic.html b/app/pkg/web/testdata/basic.htmlindex fb631d76d..fb417ce12 100755--- a/app/pkg/web/testdata/basic.html+++ b/app/pkg/web/testdata/basic.html@@ -40,7 +40,6 @@{"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"Fider"}</script>- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>diff --git a/app/pkg/web/testdata/canonical.html b/app/pkg/web/testdata/canonical.htmlindex c80b94481..2dc415d13 100755--- a/app/pkg/web/testdata/canonical.html+++ b/app/pkg/web/testdata/canonical.html@@ -42,7 +42,6 @@{"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"Fider"}</script>- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>diff --git a/app/pkg/web/testdata/chunk.html b/app/pkg/web/testdata/chunk.htmlindex 3cf31930f..15ca3765c 100644--- a/app/pkg/web/testdata/chunk.html+++ b/app/pkg/web/testdata/chunk.html@@ -47,7 +47,6 @@{"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"Fider"}</script>- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>diff --git a/app/pkg/web/testdata/oauth.html b/app/pkg/web/testdata/oauth.htmlindex e422d290a..bea6b4f33 100755--- a/app/pkg/web/testdata/oauth.html+++ b/app/pkg/web/testdata/oauth.html@@ -40,7 +40,6 @@{"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[{"provider":"google","displayName":"Google","clientID":"1234","url":"https://demo.test.fider.io:3000/oauth/google","callbackURL":"https://demo.test.fider.io:3000/oauth/google/callback","logoBlobKey":"google.png","isCustomProvider":false,"isEnabled":true}],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"Fider"}</script>- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>diff --git a/app/pkg/web/testdata/props.html b/app/pkg/web/testdata/props.htmlindex f38138677..6a0c2f735 100755--- a/app/pkg/web/testdata/props.html+++ b/app/pkg/web/testdata/props.html@@ -40,7 +40,6 @@{"contextID":"CONTEXT_ID","description":"My Page Description","props":{"array":["1","2"],"number":2,"object":{"key1":"value1","key2":"value2"}},"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"My Page Title · Fider"}</script>- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>diff --git a/app/pkg/web/testdata/tenant.html b/app/pkg/web/testdata/tenant.htmlindex 2e5b69005..94c24161f 100755--- a/app/pkg/web/testdata/tenant.html+++ b/app/pkg/web/testdata/tenant.html@@ -40,7 +40,6 @@{"contextID":"CONTEXT_ID","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":{"id":0,"name":"Game of Thrones","subdomain":"","invitation":"","welcomeMessage":"","cname":"","status":0,"isPrivate":false,"logoBlobKey":""},"title":"Game of Thrones"}</script>- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>diff --git a/app/pkg/web/testdata/user.html b/app/pkg/web/testdata/user.htmlindex 17de0a928..6a2a955a8 100755--- a/app/pkg/web/testdata/user.html+++ b/app/pkg/web/testdata/user.html@@ -40,7 +40,6 @@{"contextID":"CONTEXT_ID","description":"My Page Description","props":null,"settings":{"baseURL":"https://demo.test.fider.io:3000","buildTime":"","compiler":"","domain":"","environment":"","globalAssetsURL":"https://demo.test.fider.io:3000","googleAnalytics":"","hasLegal":false,"mode":"","oauth":[],"stripePublicKey":"","tenantAssetsURL":"https://demo.test.fider.io:3000","version":""},"tenant":null,"title":"My Page Title · Fider","user":{"avatarBlobKey":"","avatarType":"gravatar","avatarURL":"https://demo.test.fider.io:3000/avatars/gravatar/5/Jon%20Snow","email":"[email protected]","id":5,"isAdministrator":true,"isCollaborator":true,"name":"Jon Snow","role":"administrator","status":"active"}}</script>- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>diff --git a/magefile.go b/magefile.goindex 341a3024f..776d5c3aa 100644--- a/magefile.go+++ b/magefile.go@@ -29,7 +29,7 @@ var requiredDeps = []string{"golangci-lint",}var buildTime = time.Now().Format("2006.01.02.150405")-var buildNumber = os.Getenv("CIRCLE_BUILD_NUM")+var buildNumber = os.Getenv("GITHUB_RUN_ID")var exeName = "fider"var Aliases = map[string]interface{}{diff --git a/public/index.tsx b/public/index.tsxindex d5036f5b9..8748a7017 100644--- a/public/index.tsx+++ b/public/index.tsx@@ -3,7 +3,7 @@ import ReactDOM from "react-dom";import { resolveRootComponent } from "@fider/router";import { Header, Footer, Loader } from "@fider/components/common";import { ErrorBoundary } from "@fider/components";-import { classSet, Fider, FiderContext, actions, navigator } from "@fider/services";+import { classSet, Fider, FiderContext, actions } from "@fider/services";import { IconContext } from "react-icons";const Loading = () => (@@ -38,11 +38,6 @@ window.addEventListener("error", (evt: ErrorEvent) => {(() => {let fider;- if (!navigator.isBrowserSupported()) {- navigator.goTo("/browser-not-supported");- return;- }-fider = Fider.initialize();__webpack_nonce__ = fider.session.contextID;diff --git a/public/services/navigator.spec.ts b/public/services/navigator.spec.tsdeleted file mode 100644index a8a77aa97..000000000--- a/public/services/navigator.spec.ts+++ /dev/null@@ -1,32 +0,0 @@-import navigator from "./navigator";--[- "",- "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko",- "Mozilla/5.0 (Windows NT 6.0; WOW64; Trident/7.0; rv:11.0) like Gecko",- "Mozilla/5.0 (Linux; Android 6.0.1; SM-G532G Build/MMB29T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.83 Mobile Safari/537.36",- "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0",- "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15",- "Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.0 Mobile/15E148 Safari/604.1",- "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063",- "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393",-].forEach((x) => {- test(`${x} should be supported`, () => {- navigator.userAgent = () => x;- expect(navigator.isBrowserSupported()).toBeTruthy();- });-});--[- "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1)",- "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)",- "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.2; WOW64; Trident/7.0)",- "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)",- "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)",- "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)",-].forEach((x) => {- test(`${x} should NOT be supported`, () => {- navigator.userAgent = () => x;- expect(navigator.isBrowserSupported()).toBeFalsy();- });-});diff --git a/public/services/navigator.ts b/public/services/navigator.tsindex 2c879832b..ed07d48a6 100644--- a/public/services/navigator.ts+++ b/public/services/navigator.ts@@ -2,21 +2,9 @@ import { Fider, http } from "@fider/services";import { cache } from "./cache";const navigator = {- userAgent: () => {- return window.navigator.userAgent || window.navigator.appVersion;- },url: () => {return window.location.href;},- isBrowserSupported() {- const ua = this.userAgent();- const isIE = ua.indexOf("MSIE") >= 0;- if (isIE) {- // On IE, the only supported version is IE 11- return window.navigator.appVersion.indexOf("MSIE 11") >= 0;- }- return true;- },goHome: () => {window.location.href = "/";},diff --git a/tsconfig.json b/tsconfig.jsonindex 913dd1184..4bb106683 100755--- a/tsconfig.json+++ b/tsconfig.json@@ -5,13 +5,13 @@"moduleResolution": "node","esModuleInterop": true,"allowSyntheticDefaultImports": true,- "target": "es5",+ "target": "es6","strict": true,"sourceMap": true,"types": ["marked", "react", "react-dom", "react-textarea-autosize", "jest", "node"],"outDir": "./output/public","jsx": "react",- "lib": ["dom", "es2015.promise", "es5"],+ "lib": ["dom", "es2015.promise", "es6"],"experimentalDecorators": true,"emitDecoratorMetadata": true,"baseUrl": "./public",diff --git a/views/base.html b/views/base.htmlindex d843a8084..b5205bd0d 100644--- a/views/base.html+++ b/views/base.html@@ -58,7 +58,6 @@<script id="server-data" type="application/json">{{template "server-data" .}}</script>- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6,fetch" crossorigin="anonymous"></script>{{template "end-of-body" .}}{{ if .public.tenant }}{{ if .public.tenant.CustomCSS }}diff --git a/views/browser-not-supported.html b/views/browser-not-supported.htmldeleted file mode 100644index 982c0dfef..000000000--- a/views/browser-not-supported.html+++ /dev/null@@ -1,46 +0,0 @@-{{define "title"}}-Browser not supported · Fider-{{end}}--{{define "server-data"}}{{end}}--{{define "content"}}-<div class="container failure-page">- <img src="{{ .private.logo }}"/>- <h1>BROWSER NOT SUPPORTED</h1>- <p>- You are visiting this page because we detected an unsupported browser. Your browser does not support security features that we require. We highly recommend that you update your browser.- </p>- <p>- We recommend the following browsers:- </p>- <div class="c-segments l-browser-list">- <div class="c-segment">- <a href="https://www.google.com/chrome/">- <img class="browser-logo" src="https://cdn.jsdelivr.net/gh/alrra/[email protected]/src/chrome/chrome_48x48.png" alt="Google Chrome Logo" />- <span class="browser-name">Google Chrome</span>- </a>- </div>- <div class="c-segment">- <a href="https://mozilla.org/firefox">- <img class="browser-logo" src="https://cdn.jsdelivr.net/gh/alrra/[email protected]/src/firefox/firefox_48x48.png" alt="Firefox Logo" />- <span class="browser-name">Firefox</span>- </a>- </div>- <div class="c-segment">- <a href="https://www.apple.com/safari/">- <img class="browser-logo" src="https://cdn.jsdelivr.net/gh/alrra/[email protected]/src/safari/safari_48x48.png" alt="Apple Safari Logo" />- <span class="browser-name">Apple Safari</span>- </a>- </div>- <div class="c-segment">- <a href="https://www.microsoft.com/en-us/windows/microsoft-edge/microsoft-edge">- <img class="browser-logo" src="https://cdn.jsdelivr.net/gh/alrra/[email protected]/src/edge/edge_48x48.png" alt="Microsoft Edge Logo" />- <span class="browser-name">Microsoft Edge</span>- </a>- </div>- </div>-</div>-{{end}}--{{define "end-of-body"}}{{end}}\ No newline at end of file