Created
August 4, 2019 11:30
-
-
Save flyyuan/f01e4d916c3dd6f40653af3291e53146 to your computer and use it in GitHub Desktop.
Get_History_for_translate.google
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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