Support Blob for PDF view activity

RESOLVED INACTIVE

Status

()

Firefox
PDF Viewer
--
major
RESOLVED INACTIVE
5 years ago
20 hours ago

People

(Reporter: Harald, Unassigned)

Tracking

22 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [pdfjs-c-integration])

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Most Gaia apps with activities allow viewing URLs or Blobs [1]. PDF Viewer should follow that pattern and also allow both.

PDF Viewer currently fails for opening URLs with authentication. A workaround apps could would be loading the file into a Blob via XHR and sending that to the PDF Viewer. Without blob support there is no other way to open those PDFs.

This seems to be a low hanging fruit that would unblock some partners and make the PDF Viewer more versatile and better integrated with other apps.

[1]: https://github.com/mozilla-b2g/gaia/blob/master/apps/video/js/view.js#L37
(Reporter)

Comment 1

5 years ago
Brendan might have an idea on feasibility.
Flags: needinfo?(bdahl)
(Reporter)

Comment 2

5 years ago
Reference: Bug 789126 blocks loading authenticated URLs.
(Reporter)

Comment 3

5 years ago
Maybe Yury has an idea here as well.
Flags: needinfo?(ydelendik)
Can't you just get a url to the blob and then open that?
Flags: needinfo?(bdahl)
Whiteboard: [pdfjs-c-integration]
Created attachment 827097 [details]
test with mozActivity

I see the following when trying to open the page:

E/GeckoConsole( 3695): [JavaScript Error: "NS_ERROR_DOM_BAD_URI: Access to restricted URI denied" {file: "app://pdfjs.gaiamobile.org/content/build/pdf.js" line: 110}]
I/Gecko   ( 3695): NS_ERROR_DOM_BAD_URI: Access to restricted URI denied

Can app:// originated page/worker read blobs?
Flags: needinfo?(ydelendik)
(Reporter)

Comment 6

4 years ago
We need this for any app that wants to show PDFs but doesn't have a public web URL.
(Reporter)

Comment 7

4 years ago
Jonas, this is another part where Web Activities need to be standardized. When an app allows `view`ing some type of file it should take a resource from either `url` or `blob`.
Flags: needinfo?(jonas)
I think we should add the Blob support here first, rather than blocking on the standardization effort. That should be relatively easy since at worst the pdf viewer can just get a blob:-URL for the blob once it has received it.

I've also reached out to Ehsan from the WebAPI team who can help with the standardization. But we don't need to block on that.

I forget which team is responsible for the pdf viewer app. But please make sure this gets on their backlog. This should be relatively easy to do, so we could hopefully target v2.0 for this. Though it's definitely not a blocker.
Flags: needinfo?(jonas)
(In reply to Jonas Sicking (:sicking) from comment #8)

> 
> I forget which team is responsible for the pdf viewer app. But please make
> sure this gets on their backlog. This should be relatively easy to do, so we
> could hopefully target v2.0 for this. Though it's definitely not a blocker.

bdahl is our tech lead for this work. I'll follow up with him

Comment 10

20 hours ago
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 20 hours ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.