GithubHelp home page GithubHelp logo

olark / lightningjs Goto Github PK

View Code? Open in Web Editor NEW
653.0 653.0 46.0 4.79 MB

safe, fast, and asynchronous embed code for third-party Javascript delivery

License: Other

Python 18.22% JavaScript 81.78%

lightningjs's Introduction

lightningjs's People

Contributors

jbasko avatar mjpizz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lightningjs's Issues

Safety with malicious code?

Hi,

Extremely interesting project, and sorry I don't have a ton of time to kick the tires to answer this question myself - I might later today - but as far as safety, the main goal is to provide safety in terms of conflicts, not as far as sandboxing or preventing malicious third-party code fromm taking effect? It would seem that the window.parent is still fully accessible and common attacks like framebusting, cookie stealing, etc., are possible? Not saying that preventing those attacks should be a goal of this project - it seems like it's near-impossible and possibly not worth the effort without a Google Caja-like parsing/regeneration system.

How to load jQuery into my inner window?

Hey guys this is awesome.

If my third-party library depends on jquery, how would you recommend I safely load that into the same private window?

... or should I just paste it into the start of my lightening loaded lib?

thanks so much

Add on npm

Hi, You could add this library on npm? thanks!

Unable to make simple script loading to work. Is there some issue or am i missing something?

Hi,

I am trying to use lightingjs and wanted to try a simple example. But i cant even make a simple javascript to load and execute. Here is the script i am trying:

<html>
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
  <script type='text/javascript' src="./lightningjs-embed.min.js"> </script>
  <script type='text/javascript'> 
    window.piratelib = lightningjs.require("piratelib", "./sample.js");
    piratelib("testfun");
  </script>

</head>
<body>
  Hi...Hello, World!
</body>
</html>

The sample.js script has simple one line function:

var testfun = function(){
  console.log('called testfun function');
};

Can you please let me know if there is some issue with the lightingjs or am i doing something wrong?

set window.id causes exception

I've recently migrated a bookmarklet to using lightningjs and it works great except on one particular site. http://www.freepeople.com/clothes-dresses-rompers-party-dresses/ballerina-princess-dress

When invoking my deferred call the following exception is thrown "cannot call deferred method 'init' on 'undefined' ".

Ive traced it to when the site has set window.id to a non-zero value. The promiseFunctionId is getting set to this window.id value inside embed.js however this id value doesn't seem to be reflected when setting up a provide in the bootstrap.js.

I'm not sure if I'm just setting up something incorrectly or if its a bug with lightningjs.

Already asynchronous calls?

Hi,

I have some methods that are already asynchronous by nature. Is there any way for me to override the default behavior and control when the deferreds get resolved?

Otherwise, I'm going to have to break up the API and have people pass in callbacks, or return promises inside promises... that seems awkward! =)

Using this libs technique with Google Tag Manager doesn't work in Firefox

So here's the deal using this library or the technique behind it inside google tag manager (gtm) that will handle the script injection doesn't load in Firefox... it's super weird and I can't quite narrow down why it's happening.

It correctly loads the snippet pasted in gtm, creates the non-blocking iframe but fails to attach the onload attribute to the body so nothing actually gets loaded from that point! All other browsers are fine.

If I copy and paste the injected snippet from gtm and comment out the gtm code that grabs the tag it works fine in firefox.

Has anyone else come across this?

Make LightningJS support CSP

When using Content Security Policy headers, script-src 'unsafe-inline' needs to be allowed for LightningJS to run. It would be nice if it would work without.

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.