Browse Source

Make unsupported browser check asynchronous

This check is very expensive, and will pass almost 100% of the time.

Related #36728
Depends on #38329

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
tags/v28.0.0beta1
Varun Patil 1 year ago
parent
commit
98ddb81e82

+ 4
- 3
core/src/unsupported-browser-redirect.js View File

@@ -19,8 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import { testSupportedBrowser } from './utils/RedirectUnsupportedBrowsers.js'

if (!window.TESTING && !OC?.config?.no_unsupported_browser_warning) {
testSupportedBrowser()
window.addEventListener('DOMContentLoaded', async function() {
const { testSupportedBrowser } = await import('./utils/RedirectUnsupportedBrowsers.js')
testSupportedBrowser()
})
}

+ 3
- 0
dist/9551-9551.js View File

@@ -0,0 +1,3 @@
/*! For license information please see 9551-9551.js.LICENSE.txt */
(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[9551],{20452:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var o=r(45994),s=r(17499);const n=null===(i=(0,o.ts)())?(0,s.IY)().setApp("core").build():(0,s.IY)().setApp("core").setUid(i.uid).build();var i},5650:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});const o=(0,r(62556).getBuilder)("core").clearOnLogout().persist().build()},95350:(e,t,r)=>{"use strict";r.d(t,{B:()=>l});var o=r(49232),s=r(31e3),n=r.n(s),i=r(77727),u=r.n(i);const l=(0,o.z$)({allowHigherVersions:!0,browsers:u()});n()(u())},77816:(e,t,r)=>{"use strict";r.d(t,{testSupportedBrowser:()=>d});var o=r(79753),s=r(95350),n=r(5650),i=r(20452),u=r(23085).lW;const l=(0,o.generateUrl)("/unsupported"),c="true"===n.Z.getItem("unsupported-browser-ignore"),d=function(){if(s.B.test(navigator.userAgent))i.Z.debug("this browser is officially supported ! 🚀");else if(c)i.Z.debug("this browser is NOT supported but has been manually overridden ! ⚠️");else if(-1===window.location.pathname.indexOf(l)){const e=window.location.href.replace(window.location.origin,""),t=u.from(e).toString("base64");history.pushState(null,null,"".concat(l,"?redirect_url=").concat(t)),window.location.reload()}}},72950:()=>{}}]);
//# sourceMappingURL=9551-9551.js.map?v=8ba904d6389e4bbe93e3

+ 64
- 0
dist/9551-9551.js.LICENSE.txt View File

@@ -0,0 +1,64 @@
/**
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright 2021 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright 2022 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

+ 1
- 0
dist/9551-9551.js.map
File diff suppressed because it is too large
View File


+ 2
- 2
dist/core-unsupported-browser-redirect.js View File

@@ -1,3 +1,3 @@
/*! For license information please see core-unsupported-browser-redirect.js.LICENSE.txt */
(()=>{var e,r={25714:(e,r,o)=>{"use strict";var t=o(79753),n=o(49232),i=o(31e3),l=o.n(i),a=o(77727),s=o.n(a);const u=(0,n.z$)({allowHigherVersions:!0,browsers:s()});l()(s());const d=(0,o(62556).getBuilder)("core").clearOnLogout().persist().build();var c=o(45994),p=o(17499);const f=null===(b=(0,c.ts)())?(0,p.IY)().setApp("core").build():(0,p.IY)().setApp("core").setUid(b.uid).build();var b,v=o(23085).lW;const h=(0,t.generateUrl)("/unsupported"),g="true"===d.getItem("unsupported-browser-ignore");var w,y;window.TESTING||null!==(w=OC)&&void 0!==w&&null!==(y=w.config)&&void 0!==y&&y.no_unsupported_browser_warning||function(){if(u.test(navigator.userAgent))f.debug("this browser is officially supported ! 🚀");else if(g)f.debug("this browser is NOT supported but has been manually overridden ! ⚠️");else if(-1===window.location.pathname.indexOf(h)){const e=window.location.href.replace(window.location.origin,""),r=v.from(e).toString("base64");history.pushState(null,null,"".concat(h,"?redirect_url=").concat(r)),window.location.reload()}}()},72950:()=>{}},o={};function t(e){var n=o[e];if(void 0!==n)return n.exports;var i=o[e]={id:e,loaded:!1,exports:{}};return r[e].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}t.m=r,e=[],t.O=(r,o,n,i)=>{if(!o){var l=1/0;for(d=0;d<e.length;d++){o=e[d][0],n=e[d][1],i=e[d][2];for(var a=!0,s=0;s<o.length;s++)(!1&i||l>=i)&&Object.keys(t.O).every((e=>t.O[e](o[s])))?o.splice(s--,1):(a=!1,i<l&&(l=i));if(a){e.splice(d--,1);var u=n();void 0!==u&&(r=u)}}return r}i=i||0;for(var d=e.length;d>0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[o,n,i]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.j=8876,(()=>{t.b=document.baseURI||self.location.href;var e={8876:0};t.O.j=r=>0===e[r];var r=(r,o)=>{var n,i,l=o[0],a=o[1],s=o[2],u=0;if(l.some((r=>0!==e[r]))){for(n in a)t.o(a,n)&&(t.m[n]=a[n]);if(s)var d=s(t)}for(r&&r(o);u<l.length;u++)i=l[u],t.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return t.O(d)},o=self.webpackChunknextcloud=self.webpackChunknextcloud||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})(),t.nc=void 0;var n=t.O(void 0,[7874],(()=>t(25714)));n=t.O(n)})();
//# sourceMappingURL=core-unsupported-browser-redirect.js.map?v=f272594296b7d3434246
(()=>{var e,r,t,o,n={},a={};function i(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={id:e,loaded:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.loaded=!0,t.exports}i.m=n,i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((r,t)=>(i.f[t](e,r),r)),[])),i.u=e=>7874===e?"core-common.js?v=5c402e7b304792b0738d":e+"-"+e+".js?v=8ba904d6389e4bbe93e3",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="nextcloud:",i.l=(t,o,n,a)=>{if(e[t])e[t].push(o);else{var l,d;if(void 0!==n)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var s=u[c];if(s.getAttribute("src")==t||s.getAttribute("data-webpack")==r+n){l=s;break}}l||(d=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.setAttribute("data-webpack",r+n),l.src=t),e[t]=[o];var p=(r,o)=>{l.onerror=l.onload=null,clearTimeout(f);var n=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),d&&document.head.appendChild(l)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=8876,(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var r=i.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{i.b=document.baseURI||self.location.href;var e={8876:0};i.f.j=(r,t)=>{var o=i.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var n=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=n);var a=i.p+i.u(r),l=new Error;i.l(a,(t=>{if(i.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+n+": "+a+")",l.name="ChunkLoadError",l.type=n,l.request=a,o[1](l)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,n,a=t[0],l=t[1],d=t[2],u=0;if(a.some((r=>0!==e[r]))){for(o in l)i.o(l,o)&&(i.m[o]=l[o]);d&&d(i)}for(r&&r(t);u<a.length;u++)n=a[u],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},t=self.webpackChunknextcloud=self.webpackChunknextcloud||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),i.nc=void 0,window.TESTING||null!==(t=OC)&&void 0!==t&&null!==(o=t.config)&&void 0!==o&&o.no_unsupported_browser_warning||window.addEventListener("DOMContentLoaded",(async function(){const{testSupportedBrowser:e}=await Promise.all([i.e(7874),i.e(9551)]).then(i.bind(i,77816));e()}))})();
//# sourceMappingURL=core-unsupported-browser-redirect.js.map?v=f7c2db555dbb1f07ab5b

+ 0
- 44
dist/core-unsupported-browser-redirect.js.LICENSE.txt View File

@@ -1,47 +1,3 @@
/**
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright 2021 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* @copyright 2022 John Molakvoæ <skjnldsv@protonmail.com>
*

+ 1
- 1
dist/core-unsupported-browser-redirect.js.map
File diff suppressed because it is too large
View File


Loading…
Cancel
Save