Merge pull request #1116 from Dagrut/master

tarteaucitron.js: Now using document.currentScript if available
This commit is contained in:
Amauri CHAMPEAUX 2023-06-16 11:00:06 +02:00 committed by GitHub
commit ea81297334
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
/*jslint browser: true, evil: true */
var scripts = document.getElementsByTagName('script'),
path = scripts[scripts.length - 1].src.split('?')[0],
path = (document.currentScript || scripts[scripts.length - 1]).src.split('?')[0],
tarteaucitronForceCDN = (tarteaucitronForceCDN === undefined) ? '' : tarteaucitronForceCDN,
cdn = (tarteaucitronForceCDN === '') ? path.split('/').slice(0, -1).join('/') + '/' : tarteaucitronForceCDN,
alreadyLaunch = (alreadyLaunch === undefined) ? 0 : alreadyLaunch,