How to call content_script from main.js

12 views
Skip to first unread message

Kwstas Na

unread,
Nov 30, 2014, 7:35:28 AM11/30/14
to mozilla-la...@googlegroups.com
Hello.

I have read the tutorial and some of the "how to use content-script.js"

But here is my problem.

I 've made one chrome extension which works perfect.

And i want to make it also to firefox.


So how can i write the main.js

to be like the chrome background.js??


chrome.browserAction.onClicked.addListener(function(tab) {
    chrome.tabs.executeScript(tab.id, {
allFrames: true,
        file: "content_script.js"
    }, function() {
        if (chrome.runtime.lastError) {
            console.error(chrome.runtime.lastError.message);
        }
    });
});


And also how to load on the main.js the .png addon pictures?!

Fyi. isn't there any chrome to firefox extension converter? :/

Thanks a lot for your time watching this. 
Reply all
Reply to author
Forward
0 new messages