javascript - Opening new tab with URL from link element in active tab using Chrome Extension -
i'm trying create extension open new tab in chrome url of link element in active tab. i've added permissions background, tabs , activetab in manifest file. know can use
chrome.tabs.create({ url: newurl });
my issue background.js file can't access elements on active tab (or @ least haven't been able access them). there way give background file access variables within content script, or direct access dom of active tab?
is there way give background file access variables within content script, or direct access dom of active tab?
no, , no. privileged pages isolated content scripts security reasons.
you need use messaging it, e.g. send message {action: "openurl", url: newurl}
, process in background.
Comments
Post a Comment