qauMaWeb/node_modules/@soda/get-current-script/fixtures/test-polyfill.js

8 lines
217 B
JavaScript
Raw Normal View History

2024-10-13 18:02:27 +08:00
if (!('currentScript' in document)) {
Object.defineProperty(document, 'currentScript', { get: window.getCurrentScript })
}
if (document.currentScript) {
document.getElementById('app').textContent = 'It works!'
}