Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can i use the google shortener js api in xul?

21 views
Skip to first unread message

e-b...@arcor.de

unread,
Feb 10, 2013, 6:37:57 PM2/10/13
to
hi,

i want to try this example http://code.google.com/p/google-api-javascript-client/wiki/Samples in xul. How must i do it?

Where must i place this code?
<script src="https://apis.google.com/js/client.js?onload=load"></script>

I put it on the browser.xul file, but the function "load" didnt work. instead i try "?onload=myaddon.load" but it didnt works.

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://mysaddon/content/browser.css" type="text/css"?>
<!DOCTYPE overlay SYSTEM "chrome://mysaddon/locale/lang.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="chrome://myaddon/content/browser.js" type="application/javascript"/>
<script src="https://apis.google.com/js/client.js?onload=load"></script>

But i have more problems to use the google api in xul. have somebody a good tutorial, example code?

best regards
ebody

Neil

unread,
Feb 11, 2013, 4:46:04 AM2/11/13
to
e-b...@arcor.de wrote:

>i want to try this example http://code.google.com/p/google-api-javascript-client/wiki/Samples in xul. How must i do it?
>
>
Are you allowed to copy the file in to your extension? If not, the only
reliable way is to create a web page that uses that file, then create an
<iframe type="content" src="your web page"/> and communicate with that
iframe using the various examples for communicating with content.

--
Warning: May contain traces of nuts.

Rick Nelson

unread,
Mar 27, 2013, 8:10:48 PM3/27/13
to
Try <iframe src="api.html" flex="1"/>, and then create a file api.html within the folder your XUL document reading this is stored containing the necessary code and scripts for the api.
0 new messages