diff --git a/extension/command/help.js b/extension/command/help.js index 90cdeea..0e4dce1 100644 --- a/extension/command/help.js +++ b/extension/command/help.js @@ -11,7 +11,7 @@ export default class HelpCommand extends Command { "tips1": `Tips: You can use shortcut Cmd/Ctrl + L to autofocus the address bar`, "tips2": `Tips: Combine Cmd or Alt with Enter to open the search result in the new tab`, ":": `Prefix : to execute command (:cargo, :book, :yet, :stable, etc)`, - "/": `Prefix / to search nightly rust docs, prefix // to search nightly rustc docs`, + "/": `Prefix / to search nightly rust docs`, "!": `Prefix ! to search docs.rs, prefix !! to search crates.io, prefix !!! can redirect to the repository`, "~": `Prefix ~ to search external crate's docs`, "@": `Prefix @crate (e.g. @tokio) to search that crate's doc exclusively`, diff --git a/extension/script/rustc.js b/extension/script/rustc.js deleted file mode 100644 index 803506c..0000000 --- a/extension/script/rustc.js +++ /dev/null @@ -1,35 +0,0 @@ -document.addEventListener("DOMContentLoaded", () => { - // Ignore all non-rust doc pages. - if (!isRustDoc()) return; - - // rustc search index is a memory cache, therefore we don't use localStorage - // to store the cached-version. Instead, we use `rustc:check` action. - chrome.runtime.sendMessage({ action: "rustc:check" }, - response => { - let now = new Date(); - let today = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0); - if (response?.version && today <= Date.parse(response.version)) { - // Check version to ensure update search index once a day. - return; - } - injectScripts(["script/add-search-index.js"]); - } - ); -}); - -window.addEventListener("message", function (event) { - if (event.source === window && - event.data && - event.data.direction === "rust-search-extension:rustc") { - console.log(event.data); - let now = new Date(); - let version = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`; - // rustc search index is a memory cache, therefore we don't use localStorage - // to store the cached-version. Instead, we use `rustc:check` action, see above. - chrome.runtime.sendMessage({ action: "rustc:add", version, ...event.data.message }, - (response) => { - console.log(response); - } - ); - } -}); \ No newline at end of file diff --git a/manifest.jsonnet b/manifest.jsonnet index 7d69152..0f41dca 100644 --- a/manifest.jsonnet +++ b/manifest.jsonnet @@ -52,11 +52,6 @@ json css=['script/doc-rust-lang-org.css', 'script/details-toggle.css'], exclude_matches=['*://doc.rust-lang.org/nightly/nightly-rustc/*'], ) -.addContentScript( - matches=['*://doc.rust-lang.org/nightly/nightly-rustc/*'], - js=utils.js_files('script', ['lib', 'rustc', 'rust-src-navigate']), - css=['script/details-toggle.css'], -) .addContentScript( matches=['*://rust.extension.sh/update'], js=['content-script-bundle.js'] + utils.js_files('script', ['rust-extension-sh']),