Closed nickserv closed 12 years ago
Their docs don't, perhaps. Do you have version 1.7 of the SDK? The annotator example shows how to include multiple files, requires from different folders, and so on. I'd suggest looking at that one.
EDIT: nevermind, my comment is meaningless.
Instead of loading it directly in main.js, put it in a background page. More specifically...if simpleStorage has values defined for everything we need, don't create the background page. If it doesn't, create a background page, which generates those values, and sends it back using 'port' (second link).
Appropriate logic as necessary to get these hijinks running.
https://github.com/mozilla/addon-sdk/blob/master/packages/addon-kit/docs/page-worker.md https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/guides/content-scripts/using-port.html
See firefox branch, works on my machine (not Dan's, I'm guessing because of the port stuff not being valid in page workers, or getting destroyed too early).
I tried on Linux, Dan tried on Windows, and I also tried on a Mac and I haven't seen Hash Mask display on any pages. I didn't get any error messages or warnings either.
And thanks, I'll look into the injecting stuff more.
Oh also, in your third to last comment, why did you say it was meaningless?
You mean my first comment? I said it was meaningless because the example I thought existed didn't apply to the specific issue you were talking about, which was our ability to require("sjcl.js"). The example just had page scripts that were packaged in the extension.
And, yeah, I'm not really sure why it only works on my machine. It's obviously not done in general, just should be a start for you for some time. Hell, if you can just figure out how to properly and meaningfully debug stuff, that would be a big boon.
This is fixed, right?
You made the issue, I have no opinion on whether or not you close this issue. I just know that I haven't actually tested the Firefox port on a number of pages, like we've done for Chrome.
Well, it seems like this is working now, yes? Or at least we found a good way around it with the background page.
Yes, it appears to work. I still have no opinion on whether or not you close your issue. All I'm saying is that I haven't really given it any decent testing.
Well, it seems to work for me, too. I'll close this, and we can make another issue if we notice something breaking.
I'm having a hard time figuring out how to import the required libraries without copy-pasting all of our code into one file (except for inject scripts). Jetpack's docs don't seem to offer any useful information on how to properly require your own files.