Pinyin Converter Bookmarklet

Published: Sunday 30 June, 2013

A bookmarklet is a special type of bookmark that you can put in your bookmark toolbar. Our Pinyin Converter bookmarklet will allow you to quickly convert selected Chinese text from any webpage to Pinyin.


To install, simply drag the link below into your bookmark toolbar. You can rename it to something different if you want.

<-- Drag the left link into your bookmark toolbar.

Install on iPad/iPhone

Step 1: Add a Bookmark for this page

Step 2: Copy the Javascript
Copy the Javascript below.

javascript:(function(){javascript:q=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(escape(q).indexOf("%u")<0){alert("Your selection doesn't have Chinese text");}else{var i=document.createElement('iframe');i.setAttribute('name','frame-id');i.setAttribute('id','frame-id');i.setAttribute('allowtransparency','true');i.setAttribute('style','border: 0; width: 1px; height: 1px; position: absolute; left: 0; top: 0;');i.setAttribute('onload','iframeFormSubmitted();');document.body.appendChild(i);var html='<html><body>'+'<form action="" method="post" id="iframe-form" accept-charset="utf-8" target="_blank">'+'<input type="hidden" name="wdqchs" value="'+q+'"/>'+'</form>'+'<scr'+"ipt>var e=encodeURIComponent,w=window,d=document,f=d.getElementById('f');"+"d.getElementById('iframe-form').submit();"+'</scr'+"ipt></body></html>";window.frames['frame-id'].document.write(html);}void 0})();

Step 3: Edit Bookmark added in Step 1
Tap the Bookmarks button, navigate through your Bookmarks folders until you find the bookmark you just added. Click Edit, and paste the Javascript in the second field (no need to save, it's saved automatically).

That's it!

If the bookmarklet still doesn't appear, go to Safair Settings, then activate "Always Show Bookmarks Bar". 

How to Use

Select Chinese text on any webpage, click on the bookmarklet in your bookmark toolbar. You will be redirected to our Pinyin Converter page, with selected text converted.