mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 13:03:33 +00:00
Merge pull request #12164 from overleaf/msm-enable-nocdn-editor
[web] move `nocdn` checks out of overriden block GitOrigin-RevId: fc9713cc50dccd73ae0582b852ae399e61fe7424
This commit is contained in:
parent
9ecc84f0b0
commit
ecb1aaf60d
1 changed files with 10 additions and 9 deletions
|
@ -78,12 +78,13 @@ html(
|
||||||
block foot-scripts
|
block foot-scripts
|
||||||
each file in entrypointScripts(entrypoint)
|
each file in entrypointScripts(entrypoint)
|
||||||
script(type="text/javascript", nonce=scriptNonce, src=file)
|
script(type="text/javascript", nonce=scriptNonce, src=file)
|
||||||
script(type="text/javascript", nonce=scriptNonce).
|
|
||||||
//- Look for bundle
|
script(type="text/javascript", nonce=scriptNonce).
|
||||||
var cdnBlocked = typeof Frontend === 'undefined'
|
//- Look for bundle
|
||||||
//- Prevent loops
|
var cdnBlocked = typeof Frontend === 'undefined'
|
||||||
var noCdnAlreadyInUrl = window.location.href.indexOf("nocdn=true") != -1
|
//- Prevent loops
|
||||||
if (cdnBlocked && !noCdnAlreadyInUrl && navigator.userAgent.indexOf("Googlebot") == -1) {
|
var noCdnAlreadyInUrl = window.location.href.indexOf("nocdn=true") != -1
|
||||||
//- Set query param, server will not set CDN url
|
if (cdnBlocked && !noCdnAlreadyInUrl && navigator.userAgent.indexOf("Googlebot") == -1) {
|
||||||
window.location.search += "&nocdn=true";
|
//- Set query param, server will not set CDN url
|
||||||
}
|
window.location.search += "&nocdn=true";
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue