문제가, 그리고 그런게 내가 무슨 대답이 여기에 무엇을 찾는 :/내용 스크립트 알림
매니페스트 :
{
"name": "Item Sniper",
"version": "1.0",
"description": "Sniper",
"browser_action": {
"default_icon": "face.png",
"default_title": "Sniper"
},
"background": {
"scripts": ["background.js"]
},
"permissions": [
"tabs",
"notifications",
"http://*/*"
]
}
Background.js :
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.executeScript(null,{file: "buy.js"});
}
);
chrome.extension.onRequest.addListener(
function(request, sender, sendResponse) {
var notify = webkitNotifications.createNotification(
'face.png', // icon url - can be relative
'Hello!', // notification title
'Oh hellow!' // notification body text
);
});
Buy.js을 [더 많은 것이 있지만 알림 부분입니다] :
chrome.extension.sendRequest({msg: "Sup?"}, function(response) { // optional callback - gets response
console.log(response.returnMsg);
});
,
나는 기본적으로 콘텐츠 스크립트가 통지를 만들려하지만, 배경으로 JS 스크립트를 고집하면서 수 있다면 나는 몰랐어요 다음 background property가 아니라 어떤 도움/
감사합니다, 알렉스
당신이 시도 했습니까? – Oliver
'하지만 배경으로 js 스크립트를 고수하는 것이 가능한지 알지 못했습니다. 왜 작동하지 않을까요? 테스트 해 봤어? –