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

odd behaviour when "Google Analytics Opt-out Add-on" is installed #205

Closed
Flyingmana opened this issue Feb 10, 2015 · 5 comments
Closed

Comments

@Flyingmana
Copy link

if "Google Analytics Opt-out Add-on" is installed, mailcatcher has the following code as part of the mail plain text view:
window["_gaUserPrefs"] = { ioo : function() { return true; } }

https://chrome.google.com/webstore/detail/google-analytics-opt-out/fllaojicojecljbmefodhfapmkghcbnh

@sj26
Copy link
Owner

sj26 commented Jan 31, 2016

This is a problem with the addon, not with mailcatcher.

@sj26 sj26 closed this as completed Jan 31, 2016
@Flyingmana
Copy link
Author

thats possible, but it does not add this snippet to everything, So I assumed its easy to fix on mailcatchers side by adjusting the js/fetching method.

@sj26
Copy link
Owner

sj26 commented Jan 31, 2016

I'd be happy to accept a patch improving JavaScript message retrieval.

@Flyingmana
Copy link
Author

providing a patch will not be possible for me, as iam not experienced with ruby applications and how to run them locally.

But I think I found the causing part of the code here:

text = text.replace(/((http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:\/~\+#]*[\w\-\@?^=%&amp;\/~\+#])?)/g, """<a href="$1" target="_blank">$1</a>""")

what exactly should this replace do?

The problem occurs, because the plugin already injected the <script> tag when message_iframe.text() happens. But text() removes script tags, without removing the content of them.

Why does the script tag land there at all? because its an iframe, and it injects the script tag on document load I assume.

It seems for me, as there is in general an odd handling of script tags. Why not remove them fully, or encode them?
Also it lets trough other html tags like strong and span, so I would not assume thats meant as a filter.

@sj26
Copy link
Owner

sj26 commented Jan 31, 2016

Ah right. This should be fixed by #242, then.

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