SanderRonde
SanderRonde

Reputation: 301

How can i allow a background page to access the page i'm visiting

I want to have the background page in my extension access the page i'm visiting, but because the background page is loaded into background.html it can't access the current page and it isn't able to find things on the page i'm visiting.

I want some JavaScript code to be executed on the current page when i click a context-menu item. Something happening when i click it works fine and all but i can't manage to access things on the page I'm visiting.

How do i do this?

Upvotes: 0

Views: 81

Answers (1)

user2384183
user2384183

Reputation:

You'll want to use content scripts to interact with the web page and message-passing for communication between the background page and content script.

Upvotes: 1

Related Questions