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

Protect Window name interferes with basic javascript variables #569

Closed
UltraBlackLinux opened this issue Sep 4, 2023 · 2 comments
Closed

Comments

@UltraBlackLinux
Copy link

UltraBlackLinux commented Sep 4, 2023

Summary

The "Protect window name" option somehow messes with a small snippet of javascript here: https://samples.kb6.de/downloads.php

If you check at the very bottom of the page, there is an email address. If you disable chameleon, it pops up in it's entirety (mail@example.com). If you enable chameleon with the aforementioned option enabled, the javascript no longer produces a full email address, as name is empty (as can be checked in the console - console.log(name)) (@example.com). This is the snippet used (redacted to prevent spam):

<script language="JavaScript" type="text/javascript">var name = "mail"; var domain = "example.com"; document.write('<a href=\"mailto:' + name + '@' + domain + '\">'); document.write(name + '@' + domain + '</a>')</script>

I was not able to get it to empty the name variable in a simple html document containing the script.

Why is this happening?

Context (Environment)

117.0, Arch Linux

sereneblue added a commit that referenced this issue Sep 4, 2023
@sereneblue
Copy link
Owner

@UltraBlackLinux This was an issue with implementation for how the window.name is overwritten. Settings variables in JS bind to the window scope. So the above
var name = "mail"; is the same as window.name = '"mail";. Chameleon's window.name protection would overwrite window.name's getter and always return an empty string. I've corrected this to only clear window.name on initial page load which resolves this issue.

@UltraBlackLinux
Copy link
Author

awesome, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants