chrome.extension.onMessage -> chrome.runtime.onMessage
This commit is contained in:
parent
2c1987f91a
commit
a01bdf7b5a
2
apply.js
2
apply.js
|
@ -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":
|
||||||
|
|
|
@ -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);
|
||||||
|
|
2
edit.js
2
edit.js
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
2
popup.js
2
popup.js
|
@ -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":
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user