mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-29 20:11:32 +02:00
Merge pull request #29029 from overleaf/bg-td-mfb-increase-in-nocdn-metrics
Added more bots to no cdn check GitOrigin-RevId: 53da4aad749494296df02a9026e2ba294bbba6e1
This commit is contained in:
committed by
Copybot
parent
d6076a0b32
commit
80c513d715
@@ -129,11 +129,18 @@ html(
|
||||
|
||||
script(type='text/javascript' nonce=scriptNonce).
|
||||
window.addEventListener('DOMContentLoaded', function () {
|
||||
var bots = ['Bytespider', 'TikTokSpider', 'bingbot', 'Baiduspider', 'Amazonbot', 'Googlebot']
|
||||
//- Look for bundle
|
||||
var cdnBlocked = typeof Frontend === 'undefined'
|
||||
//- Prevent loops
|
||||
var noCdnAlreadyInUrl = window.location.href.indexOf('nocdn=true') != -1
|
||||
if (cdnBlocked && !noCdnAlreadyInUrl && navigator.userAgent.indexOf('Googlebot') == -1) {
|
||||
if (
|
||||
cdnBlocked &&
|
||||
!noCdnAlreadyInUrl &&
|
||||
!bots.some(function (bot) {
|
||||
return navigator.userAgent.indexOf(bot) !== -1
|
||||
})
|
||||
) {
|
||||
//- Set query param, server will not set CDN url
|
||||
window.location.search += '&nocdn=true'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user