chrome.extension.onMessage -> chrome.runtime.onMessage

This commit is contained in:
Jason 2016-01-30 18:06:04 -06:00
parent 2c1987f91a
commit a01bdf7b5a
6 changed files with 6 additions and 6 deletions

View File

@ -22,7 +22,7 @@ function requestStyles() {
chrome.runtime.sendMessage(request, applyStyles); chrome.runtime.sendMessage(request, applyStyles);
} }
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
// Also handle special request just for the pop-up // Also handle special request just for the pop-up
switch (request.method == "updatePopup" ? request.reason : request.method) { switch (request.method == "updatePopup" ? request.reason : request.method) {
case "styleDeleted": case "styleDeleted":

View File

@ -49,7 +49,7 @@ chrome.tabs.onRemoved.addListener(function(tabId, info) {
delete tabUrlHasHash[tabId]; delete tabUrlHasHash[tabId];
}); });
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
switch (request.method) { switch (request.method) {
case "getStyles": case "getStyles":
var styles = getStyles(request, sendResponse); var styles = getStyles(request, sendResponse);

View File

@ -1610,7 +1610,7 @@ function getParams() {
return params; return params;
} }
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
switch (request.method) { switch (request.method) {
case "styleUpdated": case "styleUpdated":
if (styleId == request.id) { if (styleId == request.id) {

View File

@ -165,7 +165,7 @@ function getStyleElement(event) {
return null; return null;
} }
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
switch (request.method) { switch (request.method) {
case "styleUpdated": case "styleUpdated":
handleUpdate(request.style); handleUpdate(request.style);

View File

@ -185,7 +185,7 @@ function handleDelete(id) {
} }
} }
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if (request.method == "updatePopup") { if (request.method == "updatePopup") {
switch (request.reason) { switch (request.reason) {
case "styleAdded": case "styleAdded":

View File

@ -146,7 +146,7 @@ function setupLivePrefs(IDs) {
prefs.set(this.id, isCheckbox(this) ? this.checked : this.value); prefs.set(this.id, isCheckbox(this) ? this.checked : this.value);
}); });
}); });
chrome.extension.onMessage.addListener(function(request) { chrome.runtime.onMessage.addListener(function(request) {
if (request.prefName in localIDs) { if (request.prefName in localIDs) {
updateElement(request.prefName); updateElement(request.prefName);
} }