diff --git a/README.md b/README.md index e1ae74e..b0b1d23 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ -## DNS 缓存清除 -> 一键清除chrome的DNS缓存, 并刷新当前选项卡。 web开发的利器。 +## DNS缓存杀手 +> DNS缓存杀手,一键清除chrome的DNS缓存, 并刷新当前选项卡。 web开发的利器。 ### 更新日志 +#### 2020/11/04 - v1.0.0 +* 发布到chrome store。 + #### 2018/07/29 - v0.3.0 * 兼容chrome 68+ * chrome 68+之后, 谷歌移除了原清除DNS的API方法, 所以只能通过打开`chrome://net-internals/#dns`页面, 进行js注入的方式来清除缓存。 diff --git a/background.js b/background.js index 5ea229f..9f59644 100644 --- a/background.js +++ b/background.js @@ -1,28 +1,27 @@ /** - * - * @authors yutent (yutent@doui.cc) - * @date 2018-07-07 20:59:35 - * @version $Id$ + * DNS缓存杀手 + * @author yutent + * @date 2020/11/04 17:54:49 */ chrome.browserAction.onClicked.addListener(function(ctab) { - let cid = ctab.id - let tid = null - let code = ` - let script = document.createElement('script') + var cid = ctab.id + var tid = null + var code = ` + var script = document.createElement('script') script.textContent = \` chrome.send('clearHostResolverCache') chrome.send('flushSocketPools') \` document.body.appendChild(script) ` - let callback = function() { + var callback = function() { chrome.tabs.remove(tid) chrome.tabs.executeScript(cid, { code: 'location.reload()' }) } chrome.tabs.query({}, function(tabs) { - let done = false + var done = false for (let i = 0, tab; (tab = tabs[i++]); ) { if (/^chrome:\/\/net-internals/.test(tab.url)) { tid = tab.id diff --git a/icon128.png b/icon128.png index af7cbf0..2c4f709 100644 Binary files a/icon128.png and b/icon128.png differ diff --git a/icon256.png b/icon256.png index b1fb3a9..8a36859 100644 Binary files a/icon256.png and b/icon256.png differ diff --git a/icon64.png b/icon64.png index 46f9c91..5ecf9fc 100644 Binary files a/icon64.png and b/icon64.png differ diff --git a/manifest.json b/manifest.json index 43f4f7c..2678bbc 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,8 @@ { "manifest_version": 2, - - "name": "DNS Flush", - "description": "一键清除chrome的DNS缓存, 并刷新当前选项卡。 web开发的利器。", - "version": "0.3", + "name": "dns-killer", + "description": "DNS缓存杀手,一键清除chrome的DNS缓存, 并刷新当前选项卡。 web开发的利器。", + "version": "1.0.0", "author": "yutent", "icons": { "64": "icon64.png", @@ -11,15 +10,11 @@ "256": "icon256.png" }, "background": { - "scripts": [ "background.js" ] - }, + "scripts": ["background.js"] + }, "browser_action": { "default_icon": "icon64.png" }, - "permissions": [ - "tabs", - "chrome://net-internals/#dns", - "*://*/*" - ], - "homepage_url": "https://doui.cc" + "permissions": ["tabs", "chrome://net-internals/#dns", "*://*/*"], + "homepage_url": "https://yutent.me" }