// Create a connection to the background page var backgroundPageConnection = chrome.runtime.connect({ name: "devtools-page" }); backgroundPageConnection.postMessage({ name: 'init', tabId: chrome.devtools.inspectedWindow.tabId });