{"action":"created","issue":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1112","labels_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1112/labels{/name}","comments_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1112/comments","events_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1112/events","html_url":"https://github.com/The-Compiler/qutebrowser/pull/1112","id":116642464,"number":1112,"title":"Add pdf.js support","user":{"login":"Kingdread","id":739796,"avatar_url":"https://avatars.githubusercontent.com/u/739796?v=3","gravatar_id":"","url":"https://api.github.com/users/Kingdread","html_url":"https://github.com/Kingdread","followers_url":"https://api.github.com/users/Kingdread/followers","following_url":"https://api.github.com/users/Kingdread/following{/other_user}","gists_url":"https://api.github.com/users/Kingdread/gists{/gist_id}","starred_url":"https://api.github.com/users/Kingdread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kingdread/subscriptions","organizations_url":"https://api.github.com/users/Kingdread/orgs","repos_url":"https://api.github.com/users/Kingdread/repos","events_url":"https://api.github.com/users/Kingdread/events{/privacy}","received_events_url":"https://api.github.com/users/Kingdread/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-12T21:19:09Z","updated_at":"2015-11-18T21:57:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/pulls/1112","html_url":"https://github.com/The-Compiler/qutebrowser/pull/1112","diff_url":"https://github.com/The-Compiler/qutebrowser/pull/1112.diff","patch_url":"https://github.com/The-Compiler/qutebrowser/pull/1112.patch"},"body":"Related issue: #207 \r\n\r\nI'm bypassing the same-domain restriction by generating a HTML file and embedding the PDF there in a JS array.\r\n\r\nThe viewer can be toggled with the setting `content -> enable-pdfjs`.\r\n\r\nWorks here, though I'm not that confident if I did everything right in the \"include files in package\"-stuff :wink:\r\n\r\n(The commits are a bit messy, though I can squash them if you want)"},"comment":{"url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/comments/157877659","html_url":"https://github.com/The-Compiler/qutebrowser/pull/1112#issuecomment-157877659","issue_url":"https://api.github.com/repos/The-Compiler/qutebrowser/issues/1112","id":157877659,"user":{"login":"Kingdread","id":739796,"avatar_url":"https://avatars.githubusercontent.com/u/739796?v=3","gravatar_id":"","url":"https://api.github.com/users/Kingdread","html_url":"https://github.com/Kingdread","followers_url":"https://api.github.com/users/Kingdread/followers","following_url":"https://api.github.com/users/Kingdread/following{/other_user}","gists_url":"https://api.github.com/users/Kingdread/gists{/gist_id}","starred_url":"https://api.github.com/users/Kingdread/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kingdread/subscriptions","organizations_url":"https://api.github.com/users/Kingdread/orgs","repos_url":"https://api.github.com/users/Kingdread/repos","events_url":"https://api.github.com/users/Kingdread/events{/privacy}","received_events_url":"https://api.github.com/users/Kingdread/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T21:57:16Z","updated_at":"2015-11-18T21:57:16Z","body":"Thanks for the feedback, I'll try to fix them.\r\n\r\n* I can implement that, this should be no problem.\r\n* The patching would not modify the original files (would be bad for a system-wide installation). It would happen just before returning the page to `QWebPage`. If that is too ineffiecient, I could probably work with temporary files.\r\n* Writing an update script should be no problem. I guess we'll use the packed version, not the self-built git one, as that'd require node and npm to build.\r\n* Either that, or a nice page with instructions how to get pdfjs (like the qute error page) that is shown when enable-pdfjs is `True` but no pdfjs installation is found.\r\n* Doing the request once would probably require the embedding-hack that I had before, I currently can't think of another method of passing the whole data to javascript without wasting RAM. One thing I can think of would be that we temporarily save the reply data and make it accessible via some `qute://` URL, passing that URL to pdf.js - but then again, I don't know how well this will work and if we will get problems with cross-domain requests.\r\n* I'll fix the spelling :wink:"}}