Chrome extension page action appearing outside of address bar

It appears like this is the result of a new update to Chrome, with the developers probably reasoning that most users would not know that they had extensions installed otherwise. Link to announcement: https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-extensions/upcoming/chromium-extensions/7As9MKhav5E/dNiZDoSCCQAJ It doesn’t look like extension developers can do anything about this, but I really hope Google reverts this change.

chrome.tabs.executeScript not working?

Make sure you have domain and tab permissions in the manifest: “permissions”: [ “tabs”, “http://*/*”, “https://*/*” ] Then to change body color try: chrome.tabs.executeScript(null,{code:”document.body.style.backgroundColor=”red””}); Also keep in mind that content scripts are not injected into any chrome:// or extension gallery pages. For those of you still having issues, you need to make sure to reload … Read more

How to avoid “Extension context invalidated” errors when messaging AFTER an Extension update?

When an extension is unloaded, the existing content scripts lose their connection to the rest of the extension—i.e. ports close, and they would be unable to use runtime.sendMessage()—but the content scripts themselves still continue to work, as they’re already injected into their pages. It’s the same when an extension is reloaded: those existing content scripts … Read more

cannot create item with duplicate context menu id in extension

In Chrome, you should create the context menu just once after install/update. Use onInstalled event: chrome.runtime.onInstalled.addListener(() => { chrome.contextMenus.create({ id: “zm_mark_down_preview_beta”, title: ‘preview and edit’, contexts: [“editable”] }); }); Alternatively, you can simply suppress the error by accessing lastError in the callback: chrome.contextMenus.create({ id: “zm_mark_down_preview_beta”, title: ‘preview and edit’, contexts: [“editable”] }, () => chrome.runtime.lastError);