Javascript Button In Gmail Signature [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this questionI was wondering how, or if it is even possible, to embed a javascript button in my gmail signature?
You can't. Or at least, I really, really hope you can't.
Javascript does not belong on e-mails. If it did, then people could receive nightmarishly evil emails that open an infinite number of alerts, redirect them to an offsite page, read your emails and your contact list, and so on. There are too many security repercussions of allowing Javascript inside of e-mails.
For this reason, gmail blocks javascript inside of emails, as any respectable e-mail client should.
Html emails shown in browser email clients will be stripped of all javascript so you can try but it won't work. Other clients such as outlook (which uses MS Word to render the html) also strip (or ignore?) the javascript. It's a vulnerability to allow it.
Think of this scenario: javascript on a page has full access to make ajax calls. You could use JS to iterate through all your emails and contacts etc and then send them on to a foreign server.
Allowing JS to run in emails would be the equivalent of allowing XSS.
精彩评论