Skip to content

Using dart:js and Google's javascript #52

@Goutte

Description

@Goutte

Load this in the page :

<script type="text/javascript">
  // https://developers.google.com/+/web/share/interactive
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/client:plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

When using new GoogleOAuth2(client_id, scopes); and then login, I get the cryptic :

Uncaught TypeError: Cannot call method 'replace' of undefined
(anonymous function) cb=gapi.loaded_0:464
(anonymous function) cb=gapi.loaded_0:459
g cb=gapi.loaded_0:63
c

... which is in the js loaded by https://apis.google.com/js/client:plusone.js ?
A Dart call makes a js lib fail.
Is it just me ?

I have dart:js imported as well, as I'm trying down the road to :

context['gapi']['interactivepost'].callMethod('render', ['google_plus_boast', share_options]);

but I'm not even there yet. This issue has too much shadows for me, can anyone shine some light ?


google_oauth2_client: '>=0.2.18 <1.0.0'
Dartium Version 31.0.1650.48 custom (240209).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions