I wrote a library to copy Chrome's request / feedback API for my Firefox add-on. Obviously I need to use this code in both my background process (main.js) and my content script. I certainly should be a better way out there.
A semi-documentary method of obtaining the URL SDK code modules include low-level modules, Those who are not guaranteed to be stable. In fact, it is very likely that this part of the SDK will change and this solution will not work in any way (like the basically presented solution).
He said, SDK to you. Then you will need to first use this loader to resolve the module name by using the mapping:
var {loader, ResolveURI} = Required ('Toolkit / Loader'); Var option = requirement ('@ loader / options'); Var loader = loader (option); Var Furi = Haloor (". / Foo", Loader Mapping); Generates the URL for the above code module foo . Note that you have to use the module foo , otherwise it will not be included in your extension. If you do not use it then the dummy function will be sufficient: function dummy () {required ("foo"); } Using the resulting URL as a content script works fine:
var pagemode = Required ("Page -mod"); PageMod.PageMod ({Include: "* .google.com", Content Script: When: 'End', Content Script File: [Furi, ...]});
Comments
Post a Comment