Comments (7)
There was a related discussion: #6
For now we came up with the following solution: bundle jailed.js into the application, put all other files shipped with jailed along with the bundle.
I'm going to play with bundling and proably figure out something more elegant later.
from jailed.
Yeah, that should work. Being able to rely completely on Browserify would be great though, so if you can think of a way to avoid this solution, that'd be awesome.
from jailed.
The problem is that there is some code loaded by the worker, and if not keeping it in a separate file, I would have to keep it as a string inside the main code, which is not very convenient.
from jailed.
Is it not possible to inject a simple script into the iframe, which will then call a function (doing what _JailedSite.js
does) from the parent window (window.parent.jailedSiteCallback()
)?
from jailed.
The worker cannot access the code of the iframe. I can only send a message with a string, and then evaluate it on the opposite side.
Currently I keep as a string the minimal amount of code for the worker which is needed to setup the initial communication:
https://github.com/asvd/jailed/blob/master/lib/_frame.js#L29
Then it loads _pluginWebWorker.js and sets up itself.
from jailed.
So I did implement such feature in my fork as well as some other improves like promises support. You may not want to just merge it but you can check my build process and may be reuse something from it
https://github.com/huston007/jailed. I did some code duplicates in built codebase and I see that, but code size is still pretty small.
from jailed.
@asvd do you think you can add browserify support? Bundling is getting increasingly common and shipping it by the side feels like a hack
from jailed.
Related Issues (20)
- unable to find application object
- Dom manipulation in jailed HOT 1
- Write code without application.remote HOT 2
- Just tried the base example - Getting permission issue HOT 5
- Why is the Web Worker inside an iframe? HOT 4
- Exposing values from the app to the jailed worker. HOT 1
- Best way to pass large data set into jailed script (browser)?
- Cannot read property 'whenEmitted' of undefined
- Add setting for "fallback to iframe jailing only" functionality, and timeout value
- Improve Jail Isolation via Content-Security-Policy HOT 1
- CVE-2022-23923 HOT 2
- Pass values to jailed code HOT 2
- Passing interface with sub functions not working
- Sandbox Escape Bug in jailed with Node.js
- Sandbox Escape Bug in jailed with Node.js
- Sandbox Escape in jailed with Node.js
- Sandbox Escape Bug in jailed with Node.js
- Sandbox Escape Bug in jailed with Node.js
- Sandbox Escape Bug in jailed with Node.js
- Sandbox Escape Bug in jailed with Node.js
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jailed.