Open Bug 1169148 Opened 9 years ago Updated 2 years ago

removeDelayedFrameScript() does not work with global Message Manager

Categories

(Core :: DOM: Core & HTML, defect)

31 Branch
x86
Windows XP
defect

Tracking

()

UNCONFIRMED

People

(Reporter: snuz.gary, Unassigned)

Details

Attachments

(1 file)

Attached file removeDFS.xpi
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:25.4) Gecko/20150509 Firefox/31.9 PaleMoon/25.4.1
Build ID: 20150509145745

Steps to reproduce:

call .removeDelayedFrameScript() method on frame scripts in global message manager

add the attached restartless .xpi which just calls globalMM delayed frame script injector on startup. look in ctrl+shft+J console and see infos of installed and delayed frame scripts
disable the attached restartless .xpi which calls removeDelayedFrameScript on shutdown.
open a new tab or window and verify that the delayed frame script is still injected.


Actual results:

delayed frame scripts continue to be installed in new frames


Expected results:

delayed frame scripts of the URL are no longer installed
Please add some test case or more exact steps to test this. Also you can try to reproduce this problem on Firefox Nightly 45.0a1, download it from here: https://nightly.mozilla.org/
Flags: needinfo?(snuz_2)
Ummm,,, this is why I don't like submitting bugs to bugzilla. Your repuest does not any make sense to me:
Your message asks for a test case and steps to reproduce. I see that I have attached a test case and listed the steps to reproduce in the bug report. Either you did not really read the report or you are looking for something else which is not clear from your message. Please be more specific about the problem.

It is possible that this bug no longer exists as I posted it 6 months ago, I discovered it while trying to update an extension. If it still exists, I think it is important as all restartless extensions that are not built by SDK and use messageMangers need this function to properly unload ( and with e10s, that's probably most of the extensions). It was found on the current Nightly of the day of posting (2015-5-27). I have no idea if it still exists since I had to work around it to update my extension.
Perhaps you don't understand how to see the frame scripts being injected. they will happen whenever you open a new tab as they are supposed to. closing a tab leaves them active. when the addon is disabled, it should be able to cancel this automatic loading of frame scripts into new tabs. if you make new tabs and see additional frame scripts being loaded, then the method in question is not working properly. It's purpose as I understand it is to cleanly unload the extension and its side effect of injecting frame scripts into new frames. this behaviour is helpful whenever the extension is disabled but I think it's /necessary/ when the extension updates, otherwise the new and old versions of the extension will both be injecting frame scripts into new frames until the browser is restarted.
Flags: needinfo?(snuz_2)
Hi,

I read your message, but when I go on the attachment I receive and error:"Nightly has prevented this site from installing an unverified add-on", that's why I ask you to test on Nightly. So please retest with Nightly, and see what happens on your computer, after that if you still have the problem please add the steps to recreate that problem.  
Thank you
Flags: needinfo?(snuz_2)
OS: Unspecified → Windows XP
Hardware: Unspecified → x86
(In reply to ovidiu boca from comment #4)
> Hi,
> 
> I read your message, but when I go on the attachment I receive and
> error:"Nightly has prevented this site from installing an unverified
> add-on", that's why I ask you to test on Nightly. So please retest with
> Nightly, and see what happens on your computer, after that if you still have
> the problem please add the steps to recreate that problem.  
> Thank you

I tested it on a Nightly of 4 days ago and it still looks like it's there. I think if you just save the xpi to your computer and then drag the file into the add-on manager tab of FF, it will install. You still need to explicitly enable it in the addon window to get it started. There may be a pref that enables this that i turned on in the past, but I can't find it so far. Let me know how you make out.

You will see that the code is very simple once you download it. Each frame script instance will get a random ID so that you can see when they install. You see a burst of them when the extension first starts as they get injected into each process. Opening new tabs should create new instances in the debug window. Disabling the extension executes the method in question which should stop the injection into newly created tabs and windows. but it doesn't. If you are able to verify this and decide to work on this bug, I have some suggestions to improve the method's usefulness, but let's just see if it can work first.
Flags: needinfo?(snuz_2)
the extension isn't signed because when I submitted it, the AMO signing process wasn't fully functional, but I found the pref that needs to be enabled, so for now you can download and install it:


....e signing. Add-ons that only support other applications like Thunderbird and SeaMonkey are also excluded. Unsigned add-ons can still be installed in Developer Edition, Nightly, and ESR versions of Firefox, after toggling the xpinstall.signatures.required preference in about:config.

If this doesn't work, I can get it signed at AMO
A signed version is available here which should be installable without any special effort.
 https://addons.mozilla.org/en-US/developers/addon/removedelayedframescript-bug/versions/1790142

If some one is going to take this bug, I would mention that what is really needed is not just to stop injecting frame scripts into new frames, but also stopping frame scripts in any already running frames. The message manager is the logical place to do this and this would also get rid of the famous e10s bug where frame scripts are "cached" indefinitely, actually they persist until the browser is restarted and are a real pain. I suggest adding an additional boolean argument to the method in question that also stops and releases these frame scripts. That would be a big step forward. You can contact me with any questions....
Component: Untriaged → DOM
Product: Firefox → Core
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: