@
pheyer 54Gr54uQ5LiK5YCS5piv5pyJ6byg5qCH5omL5Yq/6ISa5pys
/**
* Base64 encode selected text.
*/
var encode = function(text) {
return btoa(unescape(encodeURIComponent(text)));
};
var text = FireGestures.getSelectedText();
if (text) {
alert(encode(text));
} else {
FireGestures.setStatusText('No selected text to encode.');
}
编码
/**
* Base64 decode selected text.
*/
var decode = function(text) {
return decodeURIComponent(escape(atob(text)));
};
var text = FireGestures.getSelectedText();
if (text) {
alert(decode(text));
} else {
FireGestures.setStatusText('No selected text to decode.');
}
解码
FireGestures脚本
@
muzuiget 写的 (
https://github.com/muzuiget/firegestures-scripts)