Created
February 6, 2020 14:29
-
-
Save SergeyPirogov/db9d2adafb14a7e8c4b4c1d16f29c3ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sendCommand = (target, method, params) => | |
new Promise((resolve, reject) => { | |
chrome.debugger.sendCommand(target, method, params, result => { | |
if (chrome.runtime.lastError) { | |
reject(chrome.runtime.lastError); | |
} else { | |
resolve(result); | |
console.log(method, result); | |
} | |
}); | |
}).catch(err => { | |
console.log(method, err); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment