0

I'm working on a chrome extension, and am trying to call an existing function the page via a content script. when i type in the F12 console "pagefunction(x,y,z)". I get an immediate result, but calling it from my content script returns the error (in chrome f12 console): Uncaught Reference Error: pagefunction is not defined at... (content script & anonymous)

Does this mean that the injected script does not have access to the page script? and if so, how do i gain access to the function through my content script?

PravinS
  • 2,640
  • 3
  • 21
  • 25
  • This is thexact guide i used to inject the code ontot he page - not sure why redirecting me there would solve my problem – Nicklas Tegewaldt Feb 21 '17 at 00:19
  • 1
    Then you need to provide us actual code, a **[MCVE]**, that duplicates the problem. Be sure to include a *manifest.json*, your content script showing what script/code you are inserting into the page context and how you do it. You also need to *explain* how the answers of the proposed duplicate question do not solve your problem. As it is right now, your question **is** a duplicate of that one. You very explicitly state that you are trying to call the page function from your content, and get a ReferenceError. That is *exactly* the problem the primary answer to the proposed duplicate solves. – Makyen Feb 21 '17 at 00:52
  • formatting, spellcheck – PravinS Feb 21 '17 at 12:57

0 Answers0