I have installed the following extensions: EPUBReader and Google Translator. The latter is built using Firefox SDK and originally has a page-mod include: ["*"]
so it works only on http and https URLs. I modified the line into include: ["*","file://*","about:*"]
so that it can also work with local files and "about:" links.
The reason i added "about:*"
is because i want this extension to words on epub books that i read with EPUBReader. EPUBReader produces a URL something like this "about:epubreader?id=5". The problem is, Google Translator still won't translate anything when i double click on the words. It is interesting because whenever i try and open a fake "about:" URL that looks like "about:whatever", it works. I mean, you can double click on any word in the error page and it will translate.
I am pasting here the page-mod code snippet:
var workers = [], content_script_arr = [];
pageMod.PageMod({ /* page */
include: ["*","file://*","about:*"],
contentScriptFile: [data.url("content_script/inject.js")],
contentScriptWhen: "ready",
contentStyleFile : data.url("content_script/inject.css"),
onAttach: function(worker) {
array.add(workers, worker);
worker.on('pageshow', function() { array.add(workers, this); });
worker.on('pagehide', function() { array.remove(workers, this); });
worker.on('detach', function() { array.remove(workers, this); });
content_script_arr.forEach(function (arr) {
worker.port.on(arr[0], arr[1]);
});
}
});
Help anyone??