Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding eval support #3

Open
guillaumebriday opened this issue Nov 17, 2020 · 2 comments
Open

Adding eval support #3

guillaumebriday opened this issue Nov 17, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@guillaumebriday
Copy link
Member

No description provided.

@guillaumebriday guillaumebriday added the help wanted Extra attention is needed label Nov 17, 2020
@glaszig
Copy link

glaszig commented Jun 12, 2021

quickly took a stab at this. what happens is that rails-ujs already detects that the response is js and does the following:

// const responseText = 'alert("hello world!")'
const script = document.createElement("script")
script.setAttribute("nonce", cspNonce())
script.text = responseText

document.head
  .appendChild(script)
  .parentNode.removeChild(script)

stimulus-remote-rails then goes on and inserts what's in responseText as html.

what do you intend to do here?

@guillaumebriday
Copy link
Member Author

Hum, I need to check how it behaves, maybe there is nothing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants