Created
February 6, 2020 14:29
-
-
Save SergeyPirogov/db9d2adafb14a7e8c4b4c1d16f29c3ff to your computer and use it in GitHub Desktop.
Revisions
-
SergeyPirogov created this gist
Feb 6, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ 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); });