Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
39 lines
952 B
JavaScript
Executable file
39 lines
952 B
JavaScript
Executable file
'use strict';
|
|
/* global require, module */
|
|
/*
|
|
* You need the following pref for this to work.
|
|
* 'devtools.debugger.forbid-certified-apps': false
|
|
*
|
|
* And also the follow settings.
|
|
* 'devtools.overlay': true
|
|
* 'hud.reflows': true
|
|
*/
|
|
|
|
var fs = require('fs');
|
|
var atom = fs.readFileSync('./tests/atoms/reflow.js', {encoding: 'utf-8'});
|
|
|
|
var ReflowHelper = function(client) {
|
|
var chrome = client.scope({ context: 'chrome' });
|
|
chrome.executeScript(atom);
|
|
client.setContext('content');
|
|
|
|
this.startTracking = function(manifestURL) {
|
|
chrome.executeScript(function(url) {
|
|
window.MozReflowAtom.startTracking(url);
|
|
}, [manifestURL]);
|
|
};
|
|
|
|
this.stopTracking = function() {
|
|
chrome.executeScript(function() {
|
|
window.MozReflowAtom.stopTracking();
|
|
});
|
|
};
|
|
|
|
this.getCount = function() {
|
|
return chrome.executeScript(function() {
|
|
return window.MozReflowAtom.count;
|
|
});
|
|
};
|
|
};
|
|
|
|
module.exports = ReflowHelper;
|