-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Can't console.log() in body #185
Comments
Yep, this is a useful debugging technique. Also, it's useful to be able to use certain other globals like Something just occurred to me though – in Ractive,
Either way we should do the global whitelisting thing |
I wonder what would happen if someone would overwrite a global … I know, it's bad style. But I can imagine this being an attack vector (for example distributed over an advertisement network …). |
One way would be to compare to “builtins” of an iFrame (since it creates a new global context). |
If an attacker is able to use that vector, I think you've already lost – you wouldn't be able to use any builtins. I don't think people should expect Svelte components to resist attacks that regular JS can't. Though it would be worth documenting that you can do this to at least prevent globals being reassigned after you've created the component: <script>
export default {
helpers: {
Math
}
};
</script> |
Ah, right. This is currently possible as well. Haven't thought of that! Security is so hard … so many things to keep in mind … |
Would be nice to be able to console.log() data properties within the html/body, like you can in Ractive. I.e. {{console.log(data)}}
The text was updated successfully, but these errors were encountered: