A hack implementation of a way to track and fetch tab & pagemod workers
JavaScript Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data
doc
lib
test
README.md
package.json
package.json.backup
run.sh

README.md

Worker / Tab tracking, done wrong

This is a quick hack to implement a 'tracker' module that tracks workers attached to tabs and allows workers to be fetched and worked with.

Usage:

const Tracker = require("worker_manager").Tracker;
const tabs = require("tabs");

let test_tracker = new Tracker();

for each (let tab in tabs) {
	let worker = tab.attach({
		contentScript: 'self.port.on('say-hello', function(message) { alert(message); }',
	});

	test_tracker.register(worker);
}

test_tracker.emit(tabs.activeTab, "say-hello", "Hello World");