Gmail消息发送 API似乎正在从外发消息中删除文档类型和 HTML 注释。
生成消息.js
var email = "From: 'me'\r\n" +
"To: bradvogel@outlook.com\r\n" +
"Subject: Test Doctype\r\n" +
"Content-Type: text/html; charset=utf-8\r\n" +
"\r\n" +
"<!doctype html>" +
"<html><body>test <!--[if !mso]>hidden from outlook<!--<![endif]--> </body></html>";
var base64 = new Buffer(email).toString('base64');
var websafeBase64 = base64.replace(/\//g, '_').replace(/\+/g, '-');
console.log(websafeBase64);
Run Code Online (Sandbox Code Playgroud)
当我查看在 bradvogel@outlook.com 收到的电子邮件中的原始消息源时,它没有文档类型或注释:
To: bradvogel@outlook.com
Subject: Test Doctype
Content-Type: multipart/alternative; boundary=089e0102fc52abed0a04ff355038
--089e0102fc52abed0a04ff355038
Content-Type: text/plain; charset=UTF-8
test
--089e0102fc52abed0a04ff355038
Content-Type: text/html; charset=UTF-8
<html><body>test </body></html> …Run Code Online (Sandbox Code Playgroud) 是否可以检测到镀铬栏中浏览器操作按钮的Shift-click或Command-click?
例如,以下代码不起作用:
chrome.browserAction.onClicked.addListener(function(e) {
console.log(e.shiftKey) // is undefined
});
Run Code Online (Sandbox Code Playgroud)