From 7a152667754d78d426660bb319a88e85690ffb2c Mon Sep 17 00:00:00 2001 From: "Haoran S. Diao" <0@hairydiode.xyz> Date: Mon, 11 Feb 2019 16:00:04 -0500 Subject: initial commit --- icon.png | Bin 0 -> 3137 bytes icon.xcf | Bin 0 -> 7011 bytes manifest.json | 23 +++++++++++++++++++++++ xinhua.js | 1 + zdic.js | 7 +++++++ 5 files changed, 31 insertions(+) create mode 100644 icon.png create mode 100644 icon.xcf create mode 100644 manifest.json create mode 100644 xinhua.js create mode 100644 zdic.js diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..72688d9 Binary files /dev/null and b/icon.png differ diff --git a/icon.xcf b/icon.xcf new file mode 100644 index 0000000..06b6eea Binary files /dev/null and b/icon.xcf differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..41b6c64 --- /dev/null +++ b/manifest.json @@ -0,0 +1,23 @@ +{ + "manifest_version": 2, + "name": "去英", + "version": "0.1", + + "description": "去掉《汉典》和《新华字典》里的英文解说", + + "icons": { + "96": "icon.png" + }, + + "content_scripts": [ + { + "matches": ["*://*.xh.5156edu.com/*"], + "js": ["xinhua.js"] + }, + { + "matches": ["*://*.zdic.net/*"], + "js": ["zdic.js"] + } + ] + +} diff --git a/xinhua.js b/xinhua.js new file mode 100644 index 0000000..b527e95 --- /dev/null +++ b/xinhua.js @@ -0,0 +1 @@ +document.body.innerHTML = document.body.innerHTML.replace(/〖[a-z].*?[a-z]〗/g,"「去英」"); diff --git a/zdic.js b/zdic.js new file mode 100644 index 0000000..422450f --- /dev/null +++ b/zdic.js @@ -0,0 +1,7 @@ +tabpages = document.getElementsByClassName("tab-page"); +for(i=0; i < tabpages.length; i++){ + e = tabpages[i]; + e.innerHTML = e.innerHTML.replace(/English.*[a-z].*/g,"「去英」"); + e.innerHTML = e.innerHTML.replace(/\[.*[a-z].*\]/g,"「去英」"); + e.innerHTML = e.innerHTML.replace(/\.*[a-z].*\<\/span\>/g,"「去英」"); +} -- cgit v1.1