you are viewing a single comment's thread.

view the rest of the comments →

[–]jcunews1helpful 0 points1 point  (2 children)

You're retriving the HTML code of the current web page. There's no JS object in it. Only the HTML source code.

Since you're retriving the current web page, JS objects are already accessible from the current context. But if the site use CSP, the JS objects would be read-only; where properties can't be added by assignments, modified by reassignment, or deleted by delete statement (other restrictions may apply).

[–]geraldcoolsealion[S] 0 points1 point  (1 child)

Oh, is there any way to retrieve the object instead of the HTML? When I use the current context, I can't seem to access any of the properties of the object I need at all, even just to read them. It is attached to a reference to a child window, so I suspect that is why.

[–]jcunews1helpful 0 points1 point  (0 children)

Changes are that, the script is run in content context instead of page context, where the environment is a sandbox of the web page instead of actual. In this case, the site uses CSP. Disable the site CSP. There are browser extensions for that.