mirror of
https://github.com/Satsuoni/widevine-l3-guesser
synced 2025-02-25 00:15:23 +01:00
May now work on firefox...hopefully
This commit is contained in:
parent
9e6cc99df8
commit
5cbf7693b6
@ -30,8 +30,9 @@ function sendMessagePromise( item) {
|
||||
var event = new CustomEvent("PassToBackground", {detail: {item:item,id:id}});
|
||||
window.dispatchEvent(event);
|
||||
window.addEventListener("BackgroundReply_"+id, function(evt) {
|
||||
if(evt.detail.value) {
|
||||
resolve(evt.detail.value);
|
||||
|
||||
if(evt.detail) {
|
||||
resolve(evt.detail);
|
||||
} else {
|
||||
reject('Something wrong');
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
window.addEventListener("PassToBackground", function(evt) {
|
||||
chrome.runtime.sendMessage(evt.detail.item,response => {
|
||||
var event = new CustomEvent("BackgroundReply_"+evt.detail.id, {detail: response});
|
||||
window.dispatchEvent(event);});
|
||||
var val=response.value;
|
||||
if (!val) val=null;
|
||||
var event = new CustomEvent("BackgroundReply_"+evt.detail.id, {detail: val});
|
||||
window.dispatchEvent(event);}
|
||||
);
|
||||
}, false);
|
||||
|
||||
injectScripts();
|
||||
|
Loading…
x
Reference in New Issue
Block a user