Question

i'm working on a gmail contextual gadget (GWT) to deploy on the google market place. the gadget is triggered correctly but when i try to get content matches it fail.

<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">
....

in the browser console i see the following error:

Uncaught ReferenceError: google is not defined

any idea ?

Was it helpful?

Solution

I had exactly the same issue when working with contextual gadgets and GWT. You must prefix with $wnd like this :

var matches = $wnd.google.contentmatch.getContentMatches();

see also this thread where I figured it out :

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top