Closed Bug 642895 Opened 13 years ago Closed 13 years ago

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

Categories

(Firefox :: Extension Compatibility, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: diego.gaitan, Unassigned)

Details

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

Hello,

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" />
            </toolbaritem>
....


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

        var url = 'http://google.com';
        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 'http://google.com'

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!
Thanks,
Diego

Reproducible: Always

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

        var url = 'http://google.com';
        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 'http://google.com'

The JavaScript console does not show any errors for this problem.
I just built a simpler test: 

<browser type="content" src="http://google.com" width="470" />

This doesn't set the browser tag source to http://google.com 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,
Thanks,
Diego
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: https://forums.mozilla.org/addons/
Severity: blocker → normal
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.