[Solved] Browser storage sync get return undefined

Only code in the function passed to browser.contextMenus.onClicked.addListener is run every time. So you want to have the browser.storage.sync.get() and handling of the returned promise (the .then) inside that listener function.