Open hackel opened 7 years ago
Is this something you would like to tackle? Feel free to make amendments and submit for review, I think it's a good idea and will increase the exposure of Sprint Reader to other browsers.
Are you willing to take this on as a mini-project?
I'll definitely keep this project in mind. I'm completely new to extension development, though, so I probably won't have time to work on this for a while. Thanks!
Thanks. When (and if) I have time I will do some investigating. Feel free to let me know if you kick off this body of work- we can collaborate as it will be a good learning exercise for you.
Shall assign this mini-project to you to manage?
Depending on the code this can probably be straight forward to do without any code changes
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Porting_a_Google_Chrome_extension
I've started this. I have it mostly working, though it still seems a little weird in Firefox so I'm not quire ready to push it up.
Firefox permissions are more stringent than Chrome's. This makes it impossible to read the clipboard and get a reference to the popup window without serious retooling. This causes a conflict with the function of the 'C' hotkey and refreshing and focusing the reader if it has already been opened.
Thanks for the feedback, so what is your suggestion? What's your recommendation?
Also, are you interested in reviewing issue #18?
I'll take a look at #18.
As for this issue, the problem is that the reader.js script is neither a content script nor the background script so it can't do the extension functions in Firefox.
The reader is created by calling window.open(), and Firefox doesn't like that to be done by the background. There is another way to spawn a window but it doesn't give a reference to the actual spawned page. So there is no way to refresh and focus it later.
I haven't tried it, but if the window spawning code was moved to the content script it may be able to use window.open() and with a reference to the window I think it is possible to pass a function to the other page that will have the content script do the clipboard operation. I think you can pass functions to spawned windows though that sounds like a security problem to me, i.e. make a page that spawns Facebooks and fill it with malicious code.
At any rate, the other option for the clipboard issue is to make a button on the page to trigger it because clipboard operations are allowed to run in user generated events like 'click'.
The user already selects "Load clipboard content" from the "Play" dropdown menu. Is this a user generated event we can use?
@richardkopelow do you still have your branch for the webextensions work?
It would be great if you could remove the Chrome-specific parts of this extension (where possible) to conform to the WebExtensions standard. This would allow the extension to be installed in Firefox, Opera, or even IE.