小编Bra*_*gel的帖子

为什么 GMail API 会从外发邮件中删除文档类型和注释?

Gmail消息发送 API似乎正在从外发消息中删除文档类型和 HTML 注释。

再现

  1. 转到https://developers.google.com/gmail/api/v1/reference/users/messages/send
  2. 向下滚动到“尝试一下!”
  3. 使用 OAuth 登录
  4. 对于“userId”,输入:me
  5. 对于“原始”,输入以下节点脚本的结果:

生成消息.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)

gmail-api

5
推荐指数
1
解决办法
1286
查看次数

检测换档/命令,单击Chrome浏览器操作按钮

是否可以检测到镀铬栏中浏览器操作按钮的Shift-click或Command-click?

例如,以下代码不起作用:

chrome.browserAction.onClicked.addListener(function(e) {
    console.log(e.shiftKey) // is undefined
});
Run Code Online (Sandbox Code Playgroud)

google-chrome-extension

2
推荐指数
1
解决办法
837
查看次数

标签 统计

gmail-api ×1

google-chrome-extension ×1