-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox pdf viewer support for e10s (Bug 942707). #5115
Conversation
let PdfjsChromeUtils = { | ||
// For security purposes when running remote, we restrict preferences | ||
// content can access. | ||
_allowedPrefNames: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coding the preference names here seems unfortunate to me, since it unnecessarily increases the maintenance burden; and it's easy for this file and web/default_preferences.js to get out of sync.
I would instead suggest using the preprocessor to include DEFAULT_PREFERENCES
in this file, and then compare against those in the code below; for reference see either bootstrap.js#L54 or PdfJs.jsm#63.
@jmathies I was able to run it as an extension, however find functionality does not work. Can you look you that. Also, I was not able to run firefox pdf viewer that was build based on the https://bugzilla.mozilla.org/show_bug.cgi?id=942707 patches (just to verify if find works there). Looks like it is not hooked properly. |
Sure, I’m on pto till Monday though, will look at it when I’m back. Jim From: Yury Delendik [mailto:[email protected]] @jmathies https://github.com/jmathies I was able to run it as an extension, however find functionality does not work. Can you look you that. Also, I was not able to run firefox pdf viewer that was build based on the https://bugzilla.mozilla.org/show_bug.cgi?id=942707 patches (just to verify if find works there). Looks like it is not hooked properly. — |
updated with new set of patches from @jmathies -- looks like extension works now for e10s /botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/cf58ca7c5a891ed/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/cf58ca7c5a891ed/output.txt Total script time: 0.87 mins Published
|
dceadf0
to
aaafcc6
Compare
d71d796
to
0199d16
Compare
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/3d9639a941d1cca/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/3d9639a941d1cca/output.txt Total script time: 0.96 mins Published
|
* note, the pref names here are cross-checked against a list of | ||
* approved pdfjs prefs in chrome utils. If you add additional pdfjs | ||
* prefs update the defaults in DEFAULT_PREFERENCES and in chrome | ||
* utils _allowedPrefNames. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last sentence is no longer applicable.
Full output at http://107.22.172.223:8877/3d9639a941d1cca/output.txt Total script time: 0.96 mins
This extension is working for me. tested basic functionality, everything seems ok. |
Thank you for testing. One question is left: does my code properly cleans itself out when the extension is disabled/restarted/reinstalled/removed? |
I think you need to add a line like: cleanupJSSource(MOZCENTRAL_CONTENT_DIR + '/PdfjsChromeUtils.jsm'); for |
I tested install/uninstall. Uninstall required a restart to get the extension unloaded, but once I reboot the built-in rev came back. From: Yury Delendik [mailto:[email protected]] This extension is working for me. tested basic functionality, everything seems ok. Thank you for testing. One question is left: does my code properly cleans itself out when the extension is disabled/restarted/reinstalled/removed? — |
// Load the component and register it. | ||
pdfStreamConverterUrl = aData.resourceURI.spec + | ||
'content/PdfStreamConverter.jsm'; | ||
var pdfStreamConverterUrl = pdfBaseUrl + 'content/PdfStreamConverter.jsm'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we registering the stream converter here and in content.js for e10s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's how I understand: content for e10s content window, and browser for non-e10s window.
See browser/extensions/pdfjs/content/pdfjschildbootstrap.js
if (e10sEnabled) { | ||
let globalMM = Cc['@mozilla.org/globalmessagemanager;1'] | ||
.getService(Ci.nsIMessageListenerManager); | ||
globalMM.sendSyncMessage('PDFJS:Child:shutdown'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling the addon:
Exception running bootstrap method shutdown on [email protected]: TypeError: globalMM.sendSyncMessage is not a function (resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/bdahl/Library/Application%20Support/Firefox/Profiles/dx3hp1j0.e10s/extensions/[email protected]!/bootstrap.js:182:4) JS Stack trace: shutdown@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/bdahl/Library/Application%20Support/Firefox/Profiles/dx3hp1j0.e10s/extensions/[email protected]:182:5 < [email protected]:4304:9 < [email protected]:4418:1 < [email protected]:6741:9 < [email protected]:1084:11 < oncommand@about:addons:1:1
// Load the component and register it. | ||
pdfStreamConverterUrl = aData.resourceURI.spec + | ||
'content/PdfStreamConverter.jsm'; | ||
var pdfStreamConverterUrl = pdfBaseUrl + 'content/PdfStreamConverter.jsm'; | ||
Cu.import(pdfStreamConverterUrl); | ||
pdfStreamConverterFactory.register(PdfStreamConverter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During disable:
WARN Exception running bootstrap method startup on [email protected]: [Exception... "Component returned failure code: 0xc1f30100 (NS_ERROR_FACTORY_EXISTS) [nsIComponentRegistrar.registerFactory]" nsresult: "0xc1f30100 (NS_ERROR_FACTORY_EXISTS)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/bdahl/Library/Application%20Support/Firefox/Profiles/dx3hp1j0.e10s/extensions/[email protected]!/bootstrap.js :: register :: line 99" data: no] Stack trace: register()@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/bdahl/Library/Application%20Support/Firefox/Profiles/dx3hp1j0.e10s/extensions/[email protected]!/bootstrap.js:99 < startup()@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/bdahl/Library/Application%20Support/Firefox/Profiles/dx3hp1j0.e10s/extensions/[email protected]!/bootstrap.js:152 < XPI_callBootstrapMethod()@resource://gre/modules/addons/XPIProvider.jsm:4304 < XPI_updateAddonDisabledState()@resource://gre/modules/addons/XPIProvider.jsm:4427 < AddonWrapper_userDisabledSetter()@resource://gre/modules/addons/XPIProvider.jsm:6741 < set_userDisabled()@extensions.xml:1084 < oncommand()@about:addons:1 < file:unknown
0257c7c
to
7faa801
Compare
/botio-windows preview |
From: Bot.io (Windows)ReceivedCommand cmd_preview from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/56f027959876b4b/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/56f027959876b4b/output.txt Total script time: 1.07 mins Published
|
Firefox pdf viewer support for e10s (Bug 942707).
See https://bugzilla.mozilla.org/show_bug.cgi?id=942707