New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@soda/get-current-script

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@soda/get-current-script - npm Package Compare versions

Comparing version

to
1.0.1

fixtures/test-polyfill.html

9

index.js

@@ -17,5 +17,12 @@ // addapted from the document.currentScript polyfill by Adam Miller

function getCurrentScript () {
if (document.currentScript) {
const descriptor = Object.getOwnPropertyDescriptor(document, 'currentScript')
// for chrome
if (!descriptor && 'currentScript' in document && document.currentScript) {
return document.currentScript
}
// for other browsers with native support for currentScript
if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
return document.currentScript
}

@@ -22,0 +29,0 @@ // IE 8-10 support script readyState

6

package.json
{
"name": "@soda/get-current-script",
"version": "1.0.0",
"version": "1.0.1",
"description": "get the current executing script, with polyfills for IE9+ and Firefox",

@@ -24,3 +24,3 @@ "main": "index.js",

"devDependencies": {
"chromedriver": "^80.0.1",
"chromedriver": "^83.0.0",
"geckodriver": "^1.19.1",

@@ -30,3 +30,3 @@ "iedriver": "^3.14.1",

"selenium-server": "^3.141.59",
"serve": "^11.3.0",
"serve": "^11.3.1",
"start-server-and-test": "^1.10.8"

@@ -33,0 +33,0 @@ },

@@ -19,3 +19,12 @@ module.exports = {

.end()
},
'use it as a polyfill': function (browser) {
browser
.url(`${browser.launch_url}/fixtures/test-polyfill.html`)
.assert.containsText(
'#app',
'It works!'
)
.end()
}
}