Merge pull request #5361 from overleaf/jpa-fix-cdn-load-test

[web] rework the loading process for the CDN load test

GitOrigin-RevId: dd14ca29668e88944457e03ffd8c921e2ce93929
This commit is contained in:
Jakob Ackermann 2021-10-05 14:11:03 +02:00 committed by Copybot
parent c2a2a9b0d8
commit 4cecc6383a
5 changed files with 9 additions and 8 deletions

View file

@ -135,5 +135,3 @@ html(
//- Set query param, server will not set CDN url
window.location.search += "&nocdn=true";
}
if hasFeature('saas')
script(type="text/javascript", nonce=scriptNonce, src=buildJsPath('cdn-load-test.js'))

View file

@ -1,7 +1,9 @@
import { captureMessage } from './infrastructure/error-reporter'
var cdnLoadTest = document.createElement('img')
cdnLoadTest.addEventListener('error', function (event) {
captureMessage('CDN test image load error (cdn.overleaf.net)')
})
cdnLoadTest.src = 'https://cdn.overleaf.net/img/1p.gif'
if (window.ExposedSettings.isOverleaf) {
const cdnLoadTest = document.createElement('img')
cdnLoadTest.addEventListener('error', function () {
captureMessage('CDN test image load error (cdn.overleaf.net)')
})
cdnLoadTest.src = 'https://cdn.overleaf.net/img/1p.gif'
}

View file

@ -52,6 +52,7 @@ import './services/validateCaptcha'
import './services/validateCaptchaV3'
import './filters/formatDate'
import '../../modules/modules-main.js'
import './cdn-load-test'
angular.module('SharelatexApp').config(function ($locationProvider) {
try {
return $locationProvider.html5Mode({

View file

@ -1,6 +1,7 @@
import './utils/webpack-public-path'
import 'jquery'
import 'bootstrap'
import './cdn-load-test'
import './features/form-helpers/hydrate-form'
import './features/link-helpers/slow-link'
import './features/bookmarkable-tab'

View file

@ -12,7 +12,6 @@ const entryPoints = {
serviceWorker: './frontend/js/serviceWorker.js',
main: './frontend/js/main.js',
ide: './frontend/js/ide.js',
'cdn-load-test': './frontend/js/cdn-load-test.js',
marketing: './frontend/js/marketing.js',
style: './frontend/stylesheets/style.less',
'ieee-style': './frontend/stylesheets/ieee-style.less',