From ab19d0db172e5b1df7fcb2820e0dcd4a5d58c3c4 Mon Sep 17 00:00:00 2001 From: Dave Hughes Date: Mon, 21 Sep 2020 20:57:12 -0700 Subject: [PATCH] Remove non-standard `contextMenus.create` The await keyword will work fine with the `create` function's return (without a Promise), so by skipping the Promisification of this function, it will work in more cases, namely when used with async/await. Unfortunately, this won't work with promise chaining (using `then()`), but that can be managed by wrapping the function with `Promise.resolve()`. I have another idea about how that could also be tackled... I'll open a separate PR in a bit. Fixes #23. --- chrome-extension-async.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome-extension-async.js b/chrome-extension-async.js index eaf71d4..4e3578e 100644 --- a/chrome-extension-async.js +++ b/chrome-extension-async.js @@ -155,7 +155,7 @@ { n: 'camera', props: knownInContentSetting }, { n: 'unsandboxedPlugins', props: knownInContentSetting }, { n: 'automaticDownloads', props: knownInContentSetting }], - contextMenus: ['create', 'update', 'remove', 'removeAll'], + contextMenus: ['update', 'remove', 'removeAll'], /* 'create' omitted intentionally, it does not follow standard asynchronous pattern */ cookies: ['get', 'getAll', 'set', 'remove', 'getAllCookieStores'], debugger: ['attach', 'detach', 'sendCommand', 'getTargets'], desktopCapture: ['chooseDesktopMedia'],