Alex Bogias
Alex Bogias

Reputation: 1880

Why my simple firefox addon running 3 times

My main.js

var pageMod = require("page-mod");
pageMod.PageMod({
    include: "http://www.example.com/item/*",
    onAttach: function(worker) {
        var item_id = 19367407;
        console.log(item_id );
    }
});

my console output is:

info: ff: 19367407
----------
info: ff: 19367407
----------
info: ff: 19367407

Why i am getting it 3 times? Is there 3 workers running and why?

UPDATE: I just figured out that google ads on the "include" page was the problem! I ad-blocked them and the 2 more info's went away! How i can make it run without this problem?

Upvotes: 0

Views: 43

Answers (1)

paa
paa

Reputation: 5054

pageMod.PageMod({
    attachTo: ["top"]

Upvotes: 2

Related Questions