Skip to content

Instantly share code, notes, and snippets.

@flyyuan
Created August 4, 2019 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flyyuan/f01e4d916c3dd6f40653af3291e53146 to your computer and use it in GitHub Desktop.
Save flyyuan/f01e4d916c3dd6f40653af3291e53146 to your computer and use it in GitHub Desktop.
Get_History_for_translate.google
// ==UserScript==
// @name History for translate.google
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 将谷歌翻译的英文历史记录打印到console
// @author BennyShi
// @include https://translate.google.*/*
// @grant none
// ==/UserScript==
window.addEventListener('load', function() {
let newWord = document.getElementsByTagName('bdi');
let historyWord = ' ';
console.log(newWord)
for(let i = 0; i < newWord.length ; i++){
if (i % 4 === 0){
historyWord = newWord[i]. innerHTML +'\n'+historyWord
}
}
console.log(historyWord)
window.word = historyWord;
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment