Skip to content

Commit

Permalink
Remove non-standard contextMenus.create
Browse files Browse the repository at this point in the history
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 KeithHenry#23.
  • Loading branch information
dlh3 authored Sep 22, 2020
1 parent 39f4d72 commit ab19d0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chrome-extension-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit ab19d0d

Please sign in to comment.