Current page for browser XUL tag can't be modified (src attribute)




Extension Compatibility
7 years ago
7 years ago


(Reporter: Diego Gaitán, Unassigned)


Firefox Tracking Flags

(Not tracked)




7 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0


I have a browser tag with id='sharemeister-iframe' defined in my extension this way:

<toolbox id="navigator-toolbox">
        <toolbar toolbarname="ShareMeister toolbar" accesskey="S"
                 class="chromeclass-toolbar sharemeister-toolbar" context="toolbar-context-menu"
                 hidden="false" height="63">
            <toolbaritem id="sharemeister-ad" tooltiptext=""
                           label="" oncommand="">
                <browser id="sharemeister-iframe" type="content" src="chrome://sharemeister-firefox/content/resources/iframe_initializer.html" width="470" align="center" />

In Firefox 3.6.15 I can change the browser page displayed this way:

        var url = '';
        var iframe = document.getElementById('sharemeister-iframe');
        iframe.contentDocument.location.href = url;  // This way works fine
        iframe.setAttribute('src', url); // This way works too
        iframe.webNavigation.loadURI(url, null, null, null, null);  // And this works too

In Firefox 4 none of the three solutions above work. The browser tag never changes to ''

As none of the ways above work to change the url for the browser element I suspect it's a bug in FF 4 beta.
Please let me know your thoughts on this
I appreciate your help!

Reproducible: Always

Steps to Reproduce:
Try to change the current page for a browser XUL tag:

        var url = '';
        var iframe = document.getElementById('sharemeister-iframe');

// None of these attempts work in FF4 beta but all of them work in Firefox 3..6.15
        iframe.contentDocument.location.href = url;
        iframe.setAttribute('src', url);
        iframe.webNavigation.loadURI(url, null, null, null, null); 

Actual Results:  
The page inside the browser element never updates

Expected Results:  
Browser tag should load ''

The JavaScript console does not show any errors for this problem.

Comment 1

7 years ago
I just built a simpler test: 

<browser type="content" src="" width="470" />

This doesn't set the browser tag source to either. Google page is not loaded inside the browser tag in Firefox 4 but it works fine in Firefox 3.6.15

Any help would be appreciated,
Severity: major → blocker
OS: Mac OS X → Windows 7
I don't think this bug is valid. Hundreds of add-ons use iframe and browser elements, setting the src attribute or changing it dynamically. None of them were broken in the migration, and I think it would have been a big deal if this were true. This sounds more like a support issue, so I recommend you take it to the forum:
Severity: blocker → normal
Last Resolved: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.