GithubHelp home page GithubHelp logo

Browserify-support about jailed HOT 7 OPEN

asvd avatar asvd commented on July 22, 2024
Browserify-support

from jailed.

Comments (7)

asvd avatar asvd commented on July 22, 2024

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.

codeclown avatar codeclown commented on July 22, 2024

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.

asvd avatar asvd commented on July 22, 2024

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.

codeclown avatar codeclown commented on July 22, 2024

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.

asvd avatar asvd commented on July 22, 2024

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.

andrey-skl avatar andrey-skl commented on July 22, 2024

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.

Immortalin avatar Immortalin commented on July 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.