'File not found' message gets prompt on pdf.
Reported by
shruti.j...@etouch.net,
Jan 18 2018
|
|||||
Issue descriptionChrome Version:65.0.3324.0 (Official Build)Revision 07b221a26af55a4c3e7e375c629eb8474247f691-refs/heads/master@{#530027} (32/64-bit). OS:Win(7,8,8.1,10), Mac(10.12.6, 10.13.1, 10.13.3), Linux(14.04 LTS) What steps will reproduce the problem? (1)Launch chrome and navigate to chrome://apps download 'pdf viewer' extension. (2)Open any pdf and kill it by entering command 'chrome://kill' in omnibox. (3)Reload the pdf and observe. Actual:File not found is seen for fractions of second. Expected: Page should get navigate successfully. This is a Non-regression issue, seen from M-50 series 50.0.3263.0. Kindly review the attached screen-cast for reference.
,
Jan 18 2018
The PDF Viewer extension does not belong in component: Internals>Plugins>PDF
,
Jan 19 2018
Rob, how does PDF Viewer handle these URLs?
,
Jan 19 2018
Usually, the extension uses the webRequest API to intercept navigations to: chrome-extension://.../http://...pdf and redirects it to: chrome-extension://.../content/web/viewer.html?file=http%3A%2F%2F...pdf https://github.com/mozilla/pdf.js/blob/75dc2bbd359990ebb1c1484f204acf66c3cb8221/extensions/chromium/extension-router.js#L62-L81 If somehow the tab is loaded before the background page has loaded, then the extension reloads these tabs to ensure that the request is rewritten: https://github.com/mozilla/pdf.js/blob/75dc2bbd359990ebb1c1484f204acf66c3cb8221/extensions/chromium/extension-router.js#L83-L93 I guess that the tab request is handled before the background page has finished loading. The fix would be to delay chrome-extension:-loads until the background page has loaded. (in case of event pages, this requirement is not that strict: it is OK if the event page is still suspended when the tab is loaded, except on the first run (i.e. when "chrome.runtime.onInstalled" is to be scheduled).
,
Jan 20 2018
Interesting! As you point out, one solution would definitely be to hold off on committing urls with the extension origin until the extension fully loads. But that would also be, perhaps, a little inconsistent. In particular, requests for those URLs would work, but if an extension had a request for example.com, it wouldn't. What's more, this is really only a problem with a) the initial startup or b) if an extension is killed, because otherwise blocking webRequest is restricted to a persistent background page (where startup wouldn't be a problem). So I'm not sure that this is worth prioritizing, since it seems relatively edge-case-y, and has a "reasonable" (though certainly not ideal) solution. As a separate thought, I'm curious: have you tried out using a service worker in the extension to intercept these types of requests? Would that work better in this scenario?
,
Jan 20 2018
bug 523634 is about deferring resource loads (e.g. example.com) until extensions that use webRequest have finished loading. I haven't tried Service Workers for my extension, because it does not offer an advantage over my existing method, while at the same time it breaks extension compatibility with older Chrome versions.
,
Feb 2 2018
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by rbasuvula@chromium.org
, Jan 18 2018Status: Untriaged (was: Unconfirmed)