당신이 두 응용 프로그램을 작성하기 때문에,이 External Messaging 사용하여 아주 간단 : APP1 배경 스크립트에서
을 :
var app2id = "abcdefghijklmnoabcdefhijklmnoab2";
chrome.runtime.onMessageExternal.addListener(
// This should fire even if the app is not running, as long as it is
// included in the event page (background script)
function(request, sender, sendResponse) {
if(sender.id == app2id && request.areYouThere) sendResponse(true);
}
);
어딘가를 APP2에 :
var app1id = "abcdefghijklmnoabcdefhijklmnoab1";
chrome.runtime.sendMessage(app1id, {areYouThere: true},
function(response) {
if(response) {
// Installed and responded
} else {
// Could not connect; not installed
}
}
);
출처
2014-11-03 15:32:46
Xan
을 당신이 원하는 이유는 무엇입니까? 우리가 원하는 것을 알지 못하면 해결 방법을 제시 할 수 없습니다. –
다른 앱이나 앱을 설치 한 사용자에게 일종의 충성도 혜택을 제공 할 수 있습니다. – dragonloverlord