nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.22k stars 3.88k forks source link

Resource Loader JS API #409

Open rogerwang opened 11 years ago

rogerwang commented 11 years ago

With this API developers can write customized resource loader for WebKit.

Once JS source code protection is done, developers can protect the resources in this way.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

jeroenransijn commented 11 years ago

How would such an API work? If I understand this correctly, it would allow for protecting the source code (and also other resources?) within the application?

rogerwang commented 11 years ago

Your code should provide a callback with an argument for URL. Then the callback should return the data for the resource to WebKit. It could work in some way for stream data.

rogerwang commented 11 years ago

For source code protection please see #269 , it will be done by v8 snapshot. Simply encrypting the source (and other resources) with a key could be easily decrypted since we're open source.

Mithgol commented 11 years ago

That's right, you cannot give an end user the encypted data and the key and the decryptor's source and expect the data to stay secure :-)

RobertLowe commented 11 years ago

Totally need this; I think I'll work around this with an http server for now...

toddhay commented 10 years ago

I'd be very interested in having this as well. Any idea when this might get slotted in for development?

I'm particularly interested in changing the request headers as described at the URL below:

https://groups.google.com/forum/#!searchin/node-webkit/resource$20headers/node-webkit/SLajtsTPVlg/2BGbZrov2VgJ

verysimplenick commented 10 years ago

need protocol handler API

Mithgol commented 10 years ago

need protocol handler API

That's #951.

geekgonecrazy commented 10 years ago

This would be awesome. What's needed to finish this?

finscn commented 9 years ago

mark

slothbag commented 9 years ago

This is a great idea. I'm looking for a cross platform way to do this and its surprisingly difficult.

I started using CefSharp and had it working but then realized that CefSharp does not work on Linux/OSX.

I agree with geekgonecrazy.. whats needed to get this done? I can contribute to the bounty! How much $$ would would motivate the devs to get it done in say a few weeks?

rogerwang commented 9 years ago

Currently the testing version of 0.12.0 supports chrome.webrequest API (https://developer.chrome.com/extensions/webRequest). Will it meet your need?

slothbag commented 9 years ago

It looks like it potentially could.. i'll have a play around with it.

So will this webRequest API achieve what you wanted for this feature request? Will you be closing this issue on its release?

Update: On further investigation it doesn't look like WebRequest will allow you to intercept AND send back custom data.. so no, I dont think this will suffice.

RIAEvangelist commented 9 years ago

Take a look at the RIA folder and how it is used in this repo.

I will be porting this architecture to my framework when I flesh it out.

https://github.com/RIAEvangelist/dognews-keeper

This seems to be what people are looking for. It also uses JS pseudo classes and OOP approach.

Still has cleanup to be done to the Requires Class.