-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
use double quote around ${url} #15282
Conversation
@@ -43,12 +43,14 @@ video { | |||
} | |||
` | |||
|
|||
// Double quote around ${url} is necessary as encodeURIComponent encodes double | |||
// quote but not single quote. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not why though, right? "${url}"
is equivalent to url
, whereas '${url}'
just sets that string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I don’t understand the question. These are inside the injected JavaScript, so they are both strings. ${url}
is populated through the back-tick quote around the injected JavaScript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, to clarify:
v.setAttribute('src', "${url}")
is equivalent to:
v.setAttribute('src', url)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I think I follow what you're saying. I missed the backticks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jzila v.setAttribute('src', url)
would be equivalent to v.setAttribute('src', http://127.0.0.1:xxxx/blahblah)
. This is not evaluated by node directly, but inside the webview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it's not equivelant to that. It'd just be v.setAttribute('src', url)
and webview would not be able to find url
No description provided.