I may be wrong, but isn't it possible to implement the same thing by
injecting a `postMessage()`-based piece of code in the source code of
the page during load?

I'm doing just that in my HTML5 ebook reader. It's pretty annoying,
because this is pre-ServiceWorker code, but I suspect that this can be
done more easily with a ServiceWorker.

Cheers,
 David

On 16/06/15 17:24, Paul Rouget wrote:
> In bug 1174733, I'm proposing a patch to implement the equivalent of
> Google's webview.executeScript:
> 
> https://developer.chrome.com/apps/tags/webview#method-executeScript
> 
> This will be useful to any consumer of the Browser API to access and
> manipulate the content.
> 
> For some context: the browser.html project needs access to the DOM to
> build some sort of tab previews (not a screenshot, something based on
> colors, headers and images from the page), and we don't feel like
> adding more and more methods to the Browser API to collect all the
> information we need. It's just easier to be able to inject a script
> and tune the preview algorithm in the system app instead of changing
> the API all the time we need a new thing. It also doesn't sound like a
> terrible thing to do as other vendors do a similar thing (Android's
> executeScript, iOS's stringByEvaluatingJavaScriptFromString, and IE's
> InvokeScript).
> 
> 

-- 
David Rajchenbach-Teller, PhD
 Performance Team, Mozilla

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to