need help with small converting


stefanvd

Recommended Posts

Hi everyone,

Need an example code for the follow problem but for the Maxthon extension.

1. Send a message from the script to the background page

In Chrome it's this:

inject.js scriptchrome.extension.sendMessage({'name' : 'automatic', 'value' : value});background page:chrome.extension.onMessage.addListener(function request(request,sender,sendResponse){

if (request.name == "automatic") {chrome.tabs.executeScript(sender.tab.id, {file: "js/light.js"});}

else if (request.name == "readerlargestyle") {/* save a thing */}

});2. when the extension is installed, in the "background page" it must run a code, to show a "welcome" page. (for new users)

Thanks,

Stefan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.