Integrate pdf.js to Thunderbird
Categories
(Thunderbird :: General, defect)
Tracking
(thunderbird_esr78 wontfix)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr78 | --- | wontfix |
People
(Reporter: smaug, Assigned: standard8)
References
(Depends on 2 open bugs, Blocks 2 open bugs, )
Details
Attachments
(1 file, 8 obsolete files)
Updated•13 years ago
|
Comment 1•13 years ago
|
||
Comment 3•13 years ago
|
||
| Reporter | ||
Comment 4•13 years ago
|
||
Comment 5•13 years ago
|
||
Comment 6•13 years ago
|
||
Comment 7•12 years ago
|
||
Comment 8•12 years ago
|
||
| Assignee | ||
Comment 9•6 years ago
|
||
This adds a copy of pdfjs into mail/extensions. The copy is taken from the existing version in m-c's browser/extensions.
It also adds the two pdf files.
| Assignee | ||
Comment 10•6 years ago
|
||
This patch is enough that loading pdf files in web / special tabs works correctly. For example, from a WebExtension I can do browser.tabs.create({ "url": "http://.../mypdf.pdf" }); and it loads correctly.
I think preferences may be slightly broken here. Need to figure out how to add the "Preview in Thunderbird" option that's the same as the Firefox one (I'm currently looking at that), and at how the defaults are set for that option.
| Assignee | ||
Comment 11•6 years ago
|
||
For opening a pdf from a message, I have briefly tried it and hit what may have been the same issue as Jonathan had previously. Not quite sure as I don't have the full details.
We could try doing that part here, or in bug 766901 - depends if it is worth trying to land the web page parts of the functionality first (e.g. maybe for WebExtensions to start using?).
Comment 12•6 years ago
|
||
Instead of copying the files couldn't we directly reference them from browser in the jar.mn? Then we don't need to copy them every time they are updated in browser?
Comment 13•6 years ago
|
||
That's not how we do it, we only include directly if in toolkit. Maybe pdfjs should be in toolkit?
Comment 14•6 years ago
|
||
But it wouldn't be the first: https://searchfox.org/comm-central/search?q=..%2F..%2F..%2Fbrowser&case=false®exp=false&path=mail and we've got automatically the newest version.
| Assignee | ||
Comment 15•6 years ago
|
||
It seems that either will probably work. I'm not sure if m-c would move pdfjs into toolkit as I'm guessing it isn't really relevant to mobile.
| Assignee | ||
Comment 16•6 years ago
|
||
I've changed the main patch to reference browser/ directly. I have no idea if it is possible with locale files, so I've just copied those across. If someone wants to play around with that, feel free to, but I'm not planning on it.
| Assignee | ||
Comment 17•6 years ago
|
||
This hooks up pdfjs and gets the menu option working in preferences, but disables it by default. If you try to enable it and open a pdf from an email, then you get an error (as described previously).
In a WebExtension, I've been doing this to test it:
browser.tabs.create({
url: "http://www.orimi.com/pdf-test.pdf",
});
(the url is just a random test pdf I found).
The code for the preferences is largely copied from the browser, adapted to non-fluent. I did consider porting some of the fluent work, but that's too much for what I want to do.
I also looked at porting browser/components/preferences/in-content/tests/browser_applications_selection.js, however again the lack of fluent made this difficult.
I'm planning to look into the error you get when opening a pdf from an email, but thought it is worth starting the review process, and possibly landing these so that extensions can start to at least use parts of it.
Comment 18•6 years ago
|
||
I opened bug 1618465 about moving it to toolkit. I don't think we should reference browser/ directly, though we might need to reconsider in the future.
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
Updated•6 years ago
|
| Assignee | ||
Comment 21•6 years ago
|
||
I eventually worked out today why this wasn't fully working. The pdfjs loads itself, but pretends it is actually loading the url of the document. Since the document is based on the url of the message, we disable javascript on the docshell.
Ideally we shouldn't be doing that for this case, though I haven't yet found a way around it. Firefox has this issue when javascript is disabled globally as well (bug 866634), so it could be the fix needs to be in core somewhere.
I've been asking around in #dom on Matrix, hopefully might be able to get some help in getting that bit to work.
Comment 22•6 years ago
|
||
This should work with the two patches in bug 866634 and bug 1631305.
| Assignee | ||
Comment 23•6 years ago
|
||
This is my current WIP. Still needs some work and clean up.
| Assignee | ||
Comment 24•6 years ago
|
||
Thank you Emilio, it is working with those two patches applied :-)
I'll see if I can sort out the move to toolkit and get the patch updated over the next few days.
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 25•6 years ago
|
||
With the patches in core that have landed, and the additional patch on bug 1618465, this now gets everything working for opening pdf attachments within Thunderbird using pdfjs.
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
| Assignee | ||
Comment 29•5 years ago
|
||
Updated patch now that the move has landed. I've not run this through try server, but it seems to work fine.
Comment 30•5 years ago
|
||
Comment 31•5 years ago
|
||
The try shows bustage detected by static analysis.
Adding this should show it locally too:
ac_add_options --enable-clang-plugin
| Assignee | ||
Comment 32•5 years ago
|
||
Updated patch, fixed the refcnt issues (the NS_DECL_* macros needed adjusting).
| Assignee | ||
Comment 33•5 years ago
|
||
I can land this, though tree is closed at the moment, so flagging for landing when it re-opens (unless I get there first!).
| Assignee | ||
Comment 34•5 years ago
|
||
Depends on D86476
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Updated•5 years ago
|
Comment 35•5 years ago
|
||
Comment on attachment 9169141 [details]
Bug 810815 - Enable opening pdf attachments within Thunderbird. r=mkmelin!
Revision D86538 was moved to bug 810814. Setting attachment 9169141 [details] to obsolete.
Comment 36•5 years ago
|
||
patch had the wrong bug number. Patch is in bug 810814.
Updated•5 years ago
|
| Assignee | ||
Comment 37•5 years ago
|
||
Sorry about that, commit is: https://hg.mozilla.org/comm-central/rev/08e8b872695145ef325df8fee38139517d3f1be2
Comment 38•5 years ago
|
||
Comment 39•5 years ago
|
||
Updated•5 years ago
|
Description
•