Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is it possible to manipulate document content with Firefox for native Android?

18 views
Skip to first unread message

Gabriela Bosetti

unread,
Oct 31, 2012, 11:37:11 PM10/31/12
to
I would like to change the visual appearance of a web page... Something like this:

var css = "body { background: #FF3366 !important; }"

var body = document.getElementsByTagName("body");
if (body.length > 0) {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
body[0].appendChild(node);
}

Is it possible? Is there any documentation on this? I cant find it for native Firefox on Android

Archaeopteryx

unread,
Nov 1, 2012, 4:54:01 AM11/1/12
to
Yes, it is, see
https://developer.mozilla.org/en-US/docs/Extensions/Mobile/API/BrowserApp .
You likely want to get contentDocument from the tab you want to manipulate.

For more information about extension development for Firefox for
Android, read https://developer.mozilla.org/en-US/docs/Extensions/Mobile

Nitpick: I'd use document.querySelector in your code:
https://developer.mozilla.org/en-US/docs/DOM/document.querySelector

Archaeopteryx

-------- Original-Nachricht --------
Betreff: Is it possible to manipulate document content with Firefox for
native Android?
Von: Gabriela Bosetti <gabyb...@gmail.com>
An:
Datum: 2012-11-01 4:37

April Morone

unread,
Nov 1, 2012, 6:24:31 AM11/1/12
to Gabriela Bosetti, dev-ext...@lists.mozilla.org
May I also see the code you'd previously used fpr the visual appearance so
I can compare?
> _______________________________________________
> dev-extensions mailing list
> dev-ext...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions
>



--
http://aprilmorone.blogspot.com/

April Morone

unread,
Nov 1, 2012, 9:23:45 PM11/1/12
to Gabriela Bosetti, dev-ext...@lists.mozilla.org
Never mind. I think that Archaeopteryx gave good info.

On Wed, Oct 31, 2012 at 11:37 PM, Gabriela Bosetti <gabyb...@gmail.com>wrote:

0 new messages