Closed Bug 1324191 Opened 8 years ago Closed 7 years ago

Loading content script and messaging

Categories

(Firefox :: Extension Compatibility, defect)

51 Branch
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: antdlmr, Unassigned, NeedInfo)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36 Steps to reproduce: I've got two problems for new version Firefox (FF51.0b8, FF52 developer edition): 1. I stopped to watch the loading of content script. window.messageManager.loadFrameScript( "chrome://antff/content/content.js", true ); 2. Messaging has stopped working. var Gateway = { Init : function() { window.addEventListener( "TabSelect", this.TabSelect, true ); var obj = Cc["@mozilla.org/parentprocessmessagemanager;1"].getService( Ci.nsIMessageBroadcaster ); obj.addMessageListener( "antff_gw_tabselect", this ); }, receiveMessage: function ( mes ) { switch ( mes.name ) { case "antff_gw_tabselect": *** I have not any messages here now. console.log( "antFF::overlay.js::Gateway::antff_gw_tabselect tabid=" + mes.objects.tabid ); antFFEvent.TabSelect( mes.objects.tabid ); break; } }, TabSelect : function() { console.log( "antFF::overlay.js::Gateway::TabSelect" ); gBrowser.selectedBrowser.messageManager.sendAsyncMessage( "antff_gw_get_tabselect" ); } } Gateway.Init(); Thanks. Actual results: no result
How to reproduce the issue? Could you provide a self-contained testcase.
Flags: needinfo?(antdlmr)
Attached image ff_test1.png
Attached image ff_test2.png
Attached file antff.xpi
For clarity, it is desirable to install the software. http://antdownloadmanager.com/downloads/AntDM.1.2.3-setup.exe 1. ff_test1.png previous versions Firefox( 50 and less). The first test on the same tab of any video site. Switching between tabs hides video. 2. ff_test2.png Last version Firefox 51 or Developer Edition. Disable!!! multi-process Firefox developer Edition 3. antff.xpi in attachments or here - C:\Program Files (x86)\Ant Download Manager\antFF\antff.xpi 4. If I add log to chrome\content\overlay.js I do not see message "antFF::overlay.js::Gateway::TabSelect" TabSelect : function() { console.log( "antFF::overlay.js::Gateway::TabSelect" ); gBrowser.selectedBrowser.messageManager.sendAsyncMessage( "antff_gw_get_tabselect" ); } 5. If I add log to chrome\content\content.js I do not see message "antFF::content.js::start" console.log( "antFF::content.js::start" ); var Content = { Init : function() { addEventListener( "unload", this.Unload, true ); Thanks
In addition the addon controls a button by timer. #2 in the test, do not move the mouse pointer over the content field, let him stay on the tab for clarity of test
I remove the #4 and #5 item. I install Forefox 50 version for testing and comparison. It seems content.js:mozvisibilitychange is no longer to respond. addEventListener( "mozvisibilitychange", this.MozVisibilityChange, true ); MozVisibilityChange : function( event ) { console.log( "antFF::content.js::MozVisibilityChange" ); var tabId = content.document.documentElement.getAttribute( 'antff_tab_id' ); if ( !tabId ) tabId = '0'; var obj = Components.classes["@mozilla.org/childprocessmessagemanager;1"].getService( Components.interfaces.nsIMessageSender ); if ( obj ) obj.sendAsyncMessage( "antff_gw_mozvisibilitychange", {}, { tabid : tabId, visible : content.document.visibilityState == 'visible' } ); }
I understand, correct me if I'm wrong. You have removed the event "mozvisibilitychange", now I have to use the "visibilitychange".
Group: core-security
Group: core-security
Component: Untriaged → WebExtensions: Untriaged
Product: Core → Toolkit
WebExtensions - I know it! In small part of the project it is using. Unfortunately, WebExtensions has not quite full support chromium features. If there is no comment on the ------------ I understand, correct me if I'm wrong. You have removed the event "mozvisibilitychange", now I have to use the "visibilitychange". ---------- a question can be closed Thanks
The prefixes in the visibility API were dropped in Firefox 51. See bug 812701 and https://blog.mozilla.org/addons/2016/10/13/compatibility-for-firefox-51/
Component: WebExtensions: Untriaged → Extension Compatibility
Product: Toolkit → Firefox
Mass-closing old Extension Compatibility bugs that relate to legacy add-ons or NPAPI plug-ins. If you think this bug is still valid, please reopen or comment. Sorry for the bug spam, and happy Friday!
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: