You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
616 B
JavaScript
26 lines
616 B
JavaScript
angular.module('ngHintUI').
|
|
service('hintService', function() {
|
|
var onHintFunction;
|
|
|
|
this.setHintFunction = function(hintFunction) {
|
|
onHintFunction = hintFunction;
|
|
}
|
|
|
|
this.getHintFunction = function() {
|
|
return onHintFunction;
|
|
}
|
|
|
|
var port = chrome.extension.connect();
|
|
port.postMessage(chrome.devtools.inspectedWindow.tabId);
|
|
port.onMessage.addListener(function(msg) {
|
|
if(msg == 'refresh') {
|
|
this.messageData = [];
|
|
return;
|
|
}
|
|
onHintFunction(msg);
|
|
});
|
|
|
|
port.onDisconnect.addListener(function (a) {
|
|
console.log(a);
|
|
});
|
|
}); |