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() (eg, Promise.resolve(chrome.contextMenus.create(props)).then(console.log)). I have another idea about how that could also be tackled... I'll open a separate PR in a bit.
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 withPromise.resolve()
(eg,Promise.resolve(chrome.contextMenus.create(props)).then(console.log)
). I have another idea about how that could also be tackled... I'll open a separate PR in a bit.Fixes #23.