1

我正在开发一个 gmail 上下文小工具 (GWT),以部署在谷歌市场上。该小工具已正确触发,但是当我尝试获取内容匹配时它失败了。

<Module>
<ModulePrefs author="xxx" author_affiliation="xxx" author_email="xxx"
    directory_title="Test GMail Contextual Gadget" 
            title="Test Contextual Gadget">
    <Require feature="google.contentmatch">
        <Param name="extractors">google.com:EmailBodyExtractor</Param>
    </Require>
</ModulePrefs>
<Content type="html" view="card">
....

在浏览器控制台中,我看到以下错误:

未捕获的 ReferenceError:未定义 google

任何想法 ?

4

1 回答 1

2

在使用上下文小工具和 GWT 时,我遇到了完全相同的问题。您必须像这样以 $wnd 为前缀:

var 匹配 = $wnd.google.contentmatch.getContentMatches();

另请参阅我发现的这个线程:

https://groups.google.com/forum/#!topic/google-apps-gadgets-api/gxNoIQUVI4k

于 2011-11-22T20:37:54.873 回答