这是我的manifest.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<ApplicationManifest xmlns="http://schemas.google.com/ApplicationManifest/2009">
<Name>My test gadget</Name>
<Description>Test Gmail contextual gadgets for mail body</Description>
<Extension id="MailBodyReaderGadget" type="contextExtractor">
<Name>Mail Body Reader Gadget</Name>
<Url>google.com:EmailBodyExtractor</Url>
<Param name="body" value=".*" />
<Triggers ref="mailBodyTextWidget" />
<Scope ref="emailBody" />
<Container name="mail" />
</Extension>
<!-- our GADGET -->
<Extension id="mailBodyTextWidget" type="gadget">
<Name>Get mail body</Name>
<Url>http://test.com/spec.xml</Url>
<Container name="mail" />
</Extension>
<!-- gadget Scope -->
<Scope id="emailBody">
<Url>tag:google.com,2010:auth/contextual/extractor/BODY</Url>
<Reason>This app will show the mail body text when you click the button "Show Mail Body"</Reason>
</Scope>
</ApplicationManifest>
和spec.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs
height="200"
author=""
author_email=""
author_location="US">
<Require feature="dynamic-height"/>
<Require feature="google.contentmatch">
<Param name="extractors">
google.com:EmailBodyExtractor
</Param>
</Require>
</ModulePrefs>
<Content type="html" view="card">
<![CDATA[
<script type="text/javascript">
document.write([
"\<script src='",
("https:" == document.location.protocol) ? "https://" : "http://",
"ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js' type='text/javascript'>\<\/script>"
].join(''));
</script>
<button id="btn">Show Mail Body</button>
<div id="widget" style="heigth:300px;width:500px;">
</div>
<script>
matches = google.contentmatch.getContentMatches();
for (var match in matches) {
for (var key in matches[match]) {
$("#widget").html(matches[match][key]);
}
}
</script>
]]>
</Content>
</Module>
这是我的代码,我一直在尝试获取邮件主题以及它已经工作的电子邮件地址。但主要问题是我无法获取邮件正文。有什么解决方案可以解决这个问题吗?