0
Background
On Chrome, I have a bookmarklet called Simplified to Traditional Chinese
which translates all the simplified Chinese on the current page to traditional Chinese.
javascript:(
function() {
var s = document.getElementById("tongwenlet_tw");
if (s != null) {
document.body.removeChild(s);
}
var s = document.createElement("script");
s.language = "javascript";
s.type = "text/javascript";
s.src = "http://tongwen.openfoundry.org/NewTongWen/tools/bookmarklet_tw.js";
s.id = "tongwenlet_tw";
document.body.appendChild(s);
}
)();
Note: the actual code is below; I indented and added \n
to make it more readable:
javascript:(function(){var s=document.getElementById("tongwenlet_tw");if(s!=null){document.body.removeChild(s);}var s=document.createElement("script");s.language="javascript";s.type="text/javascript";s.src="http://tongwen.openfoundry.org/NewTongWen/tools/bookmarklet_tw.js";s.id="tongwenlet_tw";document.body.appendChild(s); })();
The code is copied from this site.
The Problem
Whenever http://tongwen.openfoundry.org/NewTongWen/tools/bookmarklet_tw.js
didn't work (their servers seem to crash frequently), this bookmark becomes useless.
I want to be able to translate a webpage regardless of whether tongwen.openfoundry.org
is up.
My Attempted Solution that Failed
I downloaded their bookmarklet_tw.js
, saved it to a local directory:
/Users/ABC/Documents/bookmarklet_tw.js
And replaced the HTTP address in the code above with:
s.src = "/Users/ABC/Documents/bookmarklet_tw.js";
But that didn't work. Can anybody help? I'm using a Macbook Pro with Chrome Version 56.0 (64 bit).
Thanks for your time and patience.
Any ideas, guys? I feel like there is a simple solution relating to JavaScript that I'm not grasping here. – Elizabeth Chu – 2017-03-19T14:41:01.043