Access variables and functions defined in page context from an extension
Underlying cause: A content script is executed in an ISOLATED “world” environment, meaning it can’t access JS functions and variables in the MAIN “world” (the page context), and can’t expose its own JS stuff, like the state() method in your case. Solution: Inject the code into the JS context of the page (MAIN “world”) using … Read more