commit 36b33d1b2b19b0e8c662310bab2e7a081d8a81bf Author: 宇天 Date: Sat Jul 7 21:05:26 2018 +0800 init project diff --git a/README.md b/README.md new file mode 100644 index 0000000..dd8db04 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +### DNS 缓存清除 +> 一键清除chrome的DNS缓存, 并刷新当前选项卡。 web开发的利器。 + + diff --git a/background.js b/background.js new file mode 100644 index 0000000..a649689 --- /dev/null +++ b/background.js @@ -0,0 +1,12 @@ +/** + * + * @authors yutent (yutent@doui.cc) + * @date 2018-07-07 20:59:35 + * @version $Id$ + */ + +chrome.browserAction.onClicked.addListener(function(tab) { + chrome.benchmarking.clearHostResolverCache() + chrome.benchmarking.closeConnections() + chrome.tabs.executeScript(tab.id, { code: 'location.reload()' }) +}) diff --git a/icon128.png b/icon128.png new file mode 100644 index 0000000..af7cbf0 Binary files /dev/null and b/icon128.png differ diff --git a/icon256.png b/icon256.png new file mode 100644 index 0000000..b1fb3a9 Binary files /dev/null and b/icon256.png differ diff --git a/icon64.png b/icon64.png new file mode 100644 index 0000000..46f9c91 Binary files /dev/null and b/icon64.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..9a87fe7 --- /dev/null +++ b/manifest.json @@ -0,0 +1,24 @@ +{ + "manifest_version": 2, + + "name": "DNS Flush", + "description": "一键清除chrome的DNS缓存, 并刷新当前选项卡。 web开发的利器。", + "version": "0.2", + "author": "yutent", + "icons": { + "64": "icon64.png", + "128": "icon128.png", + "256": "icon256.png" + }, + "background": { + "scripts": [ "background.js" ] + }, + "browser_action": { + "default_icon": "icon64.png" + }, + "permissions": [ + "tabs", + "*://*/*" + ], + "homepage_url": "https://doui.cc" +}