MozillaZine

document.html referer

Talk about add-ons and extension development.
Diamanti
 
Posts: 700
Joined: June 12th, 2008, 9:02 am

Post Posted November 8th, 2016, 2:49 am

when:

html, body{
background-color:#000 !important;
}

in js i referer to body in extension with:
content.document.body

content.document.html no work.
how referer to html?

morat
 
Posts: 2451
Joined: February 3rd, 2009, 6:29 pm

Post Posted November 8th, 2016, 4:38 am

You should use document.documentElement to get the root element.

Code: Select all
alert(content.document.documentElement.tagName); // HTML

Diamanti
 
Posts: 700
Joined: June 12th, 2008, 9:02 am

Post Posted November 8th, 2016, 4:55 am

ty

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 4 guests