firefox - I am unable to access docShell for my browser element in xul? -



firefox - I am unable to access docShell for my browser element in xul? -

<browser id="search" type="content-targetable" src="www.google.com"> </browser>

javascript code

// using script set property of browser element var x=document.getelementbyid('search'); x.docshell.allowauth="false" // code stops here x.docshell.allowplugin="false" //this not work

as many xul tags, <browser> tag isn't inherently "special" - "special" functionality added xbl. of import thing xbl bindings added via css rules , these css rules apply element has inserted document. of import insert element first , access special properties after that. of course, in case asynchronous initialization might required improve like:

class="lang-js prettyprint-override">var browser = document.createelement(browser); parent.appendchild(browser); window.settimeout(initbrowser, 0); function initbrowser() { x.docshell.allowauth = false; ... browser.loaduri("...", null, null); }

note it's docshell (your illustration used wrong captalization) , allowauth boolean, not string.

firefox browser firefox-addon xul

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -