Firefox extension custom fonts

前端 未结 2 1234
旧巷少年郎
旧巷少年郎 2020-11-28 14:39

I am using the Firefox Add-on SDK to create an extension and am performing a PageMod. This code is in main.js.

...
exports.main = function() {
          


        
2条回答
  •  心在旅途
    2020-11-28 15:11

    I think you need to use absolute paths in those url fields. So figure out what seld.data.url('fonts') (by like console.log'ing it) (the path should be something like resource://weraweraer-at-jetpack/data/fonts) and then update your url's to use that path.

    I'm pretty sure this should work because resource url's don't have security restrictions. See this page here: https://developer.mozilla.org/en-US/docs/Chrome_Registration#resource

    It says:

    Note: There are no security restrictions preventing web content from including content at resource: URIs, so take care what you make visible there.

提交回复
热议问题