Closed Bug 634690 Opened 15 years ago Closed 4 years ago

window.messageManager.loadFrameScript() loads content script into tabs in foreign window

Categories

(Core :: DOM: Content Processes, defect, P5)

x86
Windows Vista
defect

Tracking

()

RESOLVED WONTFIX

People

(Reporter: yuki, Unassigned)

Details

Build identifier: Mozilla/5.0 (Windows NT 6.0; rv:2.0b12pre) Gecko/20110216 Firefox/4.0b12pre window.messageManager.loadFrameScript() can be used to load content scripts into all existing tabs in the window. However, this method doesn't work as I expected when there is any tab which is moved from/to another window. Steps to reproduce: 1. Open two browser windows, A and B. 2. Open two tabs in each windows. Then, the window A has two tabs A-1 and A-2. The window B also has two tabs B-1 and B-2. 3. Move the tab A-2 to the window B. Then, the window A has only one tab A-1 and the window B has three tabs: B-1, B-2 and A-2. 4. Run following script in the window A. ---------------------------------------------- var script = 'data:application/javascript,'+encodeURIComponent(<![CDATA[ content.document.title = 'LOADED'; ]]>.toString()); messageManager.loadFrameScript(script, false); ---------------------------------------------- 5. Reload all tabs: A-1, A-2, B-1 and B-2. Expected result: The only one tab A-1 in the window A has the tab label "LOADED". Actual result: Two tabs, A-1 in the window A and A-2 in the window B have the tab label "LOADED". If you do the step 4 on the window B, then, all three tabs in the window B should have the label "LOADED", but actually only two tabs B-1 and B-2 (they are originally generated in the window B) have the label "LOADED". The script is not loaded to the tab A-2 even if it is in the window B.
Oops, the step 5 is unnecessary. Please ignore the step 5.
Component: IPC → DOM: Content Processes
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.