Skip to content

how to inject window object(for example, window.location) into the rhino execution #1487

Answered by p-bakker
orzyoung asked this question in Q&A
Discussion options

You must be logged in to vote

Assuming you know that window.location is a (clientside) browser thing, whereas Rhino is a serverside JavaScript that doesn't know anything about browser-specific APIs: if you're embedding rhino, you can expose custom host objects, so you can inject an object with a location property under the 'window' name. See our documentation on embedding for more details

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by orzyoung
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants