Socket
Socket
Sign inDemoInstall

browser-module-sandbox

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-module-sandbox - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

1

collaborators.md

@@ -6,3 +6,4 @@ ## Collaborators

<table><tbody><tr><th align="left">maxogden</th><td><a href="https://github.com/maxogden">GitHub/maxogden</a></td></tr>
<tr><th align="left">voronianski</th><td><a href="https://github.com/voronianski">GitHub/voronianski</a></td></tr>
<tr><th align="left">maurizzzio</th><td><a href="https://github.com/maurizzzio">GitHub/maurizzzio</a></td></tr>
</tbody></table>

36

index.js

@@ -21,3 +21,3 @@ var inherits = require('inherits')

this.iframe = iframe({ container: this.container, scrollingDisabled: true })
this.iframeStyle = "<style type='text/css'>" +
this.iframeStyle = "<style type='text/css'>" +
"html, body { margin: 0; padding: 0; border: 0; }\n" +

@@ -34,7 +34,7 @@ opts.iframeStyle +

var self = this
var modules = detective(entry)
self.emit('bundleStart')
if (modules.length === 0) return makeIframe()

@@ -56,3 +56,5 @@

if (cached[module]) {
allBundles += cached[module]['bundle']
var tokens = module.split('@');
var bundle = !tokens[0] ? cached[module]['bundle'].replace(encodeURIComponent(tokens[1]), tokens[1]) : cached[module]['bundle']
allBundles += bundle
packages.push(cached[module]['package'])

@@ -63,3 +65,3 @@ } else {

})
if (download.length === 0) {

@@ -76,10 +78,16 @@ self.emit('modules', packages)

}
download.map(function(module) {
var tokens = module.split('@')
var name = tokens[0]
var version = tokens[1]
var name, version
if (!tokens[0]) {
name = '@'+encodeURIComponent(tokens[1])
version = tokens[2]
} else {
name = tokens[0]
version = tokens[1]
}
body.dependencies[name] = version
})
request({method: "POST", body: JSON.stringify(body), url: self.cdn + '/multi'}, downloadedModules)

@@ -113,3 +121,3 @@ })

var existing = json[module]
json[module + '@' + existing.package.version] = json[module]
json[decodeURIComponent(module) + '@' + existing.package.version] = json[module]
delete json[module]

@@ -119,3 +127,5 @@ })

Object.keys(json).forEach(function(module) {
allBundles += json[module]['bundle']
var tokens = module.split('@');
var bundle = !tokens[0] ? json[module]['bundle'].replace(encodeURIComponent(tokens[1]), tokens[1]) : json[module]['bundle']
allBundles += bundle
packages.push(json[module]['package'])

@@ -129,3 +139,3 @@ })

}
function makeIframe(script) {

@@ -132,0 +142,0 @@ script = (script || '')

{
"name": "browser-module-sandbox",
"version": "1.4.0",
"version": "1.4.1",
"description": "uses browserify-cdn to run node code in an iframe",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc