Closed KwanEsq closed 4 years ago
I prefer to put the file in the repo, instead of unnecessarily relaxing the Content Security Policy.
After doing that, using .data =
(or .src =
? when I tested back then, the two exhibited different behaviors, if I recall correctly) should fix the detection method.
I've fixed the implementation. It will be added in the next release (2.11), which I haven't scheduled yet.
2.11 has been published.
So while working on #52 I've discovered that the PDFJS checking code doesn't actually seem to do anything, and just always timeouts and returns true. The first issue is a simple typo,
https://github.com/Rob--W/open-in-browser/blob/26df4dbaa2fb82a2d24ddc0d7ca30300adee2538/extension/content-handlers-firefox.js#L152-L155
using
src
instead ofdata
means it doesn't try and load the file. Secondly, once that is fixed, loading the file is blocked anyway due to CSP. That can be fixed with a custom CSP in the manifest.json, like