Report 2 problems related to Firefox extension development

Luca Greco lgreco at mozilla.com
Mon Nov 6 16:43:35 UTC 2017


On Mon, Nov 6, 2017 at 12:48 PM, wei_huang at trendmicro.com.cn <
wei_huang at trendmicro.com.cn> wrote:

> Dear Mozilla support team
>
>
>
> This is Wei Huang, a FF extension developer.
>
>
>
> I’m writing this mail to ask for your help on 2 problems I encountered
> recently.
>
>
>
> *[Basic Information]*
>
> Firefox Version:
>
> (1).Firefox Release Edition  56.0.2 (32-bit)
>
> (2).Firefox Dev Edition 57.0b14 (64-bit)
>
>
>
> *[Problems Description]*
>
> #1. I happened to find that 2 strange js files, which are not belong to my
> extension, were injected with the content script jses of my extension. (Refer
> to attached #1.png)
>
> I’m wondering what are these jses used for? Are there any impact to my
> extension?
>

Every extension has its own content script sandbox, and so the content
scripts that are not part of your extension
are not injected in your extension content script sandbox, but there is
definitely an issue to fix on the debugger UI side,
which doesn't currently show the extension uuid in the left sidebar outline
and so it is not currently clear enough which is the related extension
(the extension uuid is only partially visible when hovering with the mouse
the filename on the opened source tabs).


>
> #2. Some content script files defined in manifest.json are not injected
> into target web page.
>
> As shown in #2_1.jpg & #2_2.jpg, when accessing Facebook setting page(
> https://www.facebook.com/settings?tab=privacy), all the jses that match
> "*://*.facebook.com/settings*" should be injected.
>
> However, most of these content script files are missing on this page.
>
> One interesting thing is that, the #2 issue only happens on signed xpi.
> When I extract the xpi, and load a temporary extension in debug mode, the
> issue is improved.
>
> I have no idea what’s going on with this issue.
>

If the file is not listed in the debugger panel, there could be a loading
error (which should be listed in the Browser Console, Bug 1410932 aims to
make this kind of errors visible in the tab developer tools as well).

If there is no loading error related to the extension, it could be worth to
investigate if the extension content scripts have been loaded and
they are just not listed in the Debugger UI, e.g. by temporarily adding a
new content script url at the end of the content scripts js array
which just produces a "console.log" message (because the content scripts
are loaded in the same order of the js array in the content_scripts
manifest property and,
at least currently, if any of the script fails to load then all the
subsequent scripts are not going to be loaded).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/dev-addons/attachments/20171106/95967286/attachment.html>


More information about the Dev-addons mailing list