Add constants

This commit is contained in:
Folyd 2024-06-07 00:11:15 -07:00
parent 4b679bd1bc
commit 179c47d93b
4 changed files with 23 additions and 5 deletions

2
core

@ -1 +1 @@
Subproject commit 1a9d7d1b474751652ed5cc124a51bb266c269608
Subproject commit e0a846d1850894378e36f684cad1692fc244a32e

11
extension/constants.js Normal file
View file

@ -0,0 +1,11 @@
const INDEX_UPDATE_URL = "https://rust.extension.sh/update";
const RUST_RELEASE_README_URL = "https://github.com/rust-lang/rust/blob/master/RELEASES.md";
const LINT_URL = "https://rust-lang.github.io/rust-clippy/master/";
const REDIRECT_URL = chrome.runtime.getURL("manage/redirect.html");
export {
INDEX_UPDATE_URL,
LINT_URL,
REDIRECT_URL,
RUST_RELEASE_README_URL,
}

View file

@ -21,9 +21,13 @@ import HistoryCommand from "./core/command/history.js";
import CommandManager from "./core/command/manager.js";
import CrateDocManager from "./crate-manager.js";
import { Compat } from "./core/index.js";
import {
INDEX_UPDATE_URL,
LINT_URL,
REDIRECT_URL,
RUST_RELEASE_README_URL,
} from "./constants.js";
const INDEX_UPDATE_URL = "https://rust.extension.sh/update";
const RUST_RELEASE_README_URL = "https://github.com/rust-lang/rust/blob/master/RELEASES.md";
// Get the information about the current platform os.
// Possible os values: "mac", "win", "android", "cros", "linux", or "openbsd"
@ -293,7 +297,6 @@ async function start(omnibox) {
},
});
const REDIRECT_URL = chrome.runtime.getURL("manage/redirect.html");
omnibox.addPrefixQueryEvent("!!!", {
name: "Repository",
onSearch: (query) => {
@ -391,7 +394,6 @@ async function start(omnibox) {
},
});
const LINT_URL = "https://rust-lang.github.io/rust-clippy/master/";
omnibox.addPrefixQueryEvent(">", {
name: "Clippy lints",
onSearch: (query) => {

View file

@ -1,6 +1,11 @@
import { Omnibox, Compat } from "./core/index.js";
import IndexManager from "./index-manager.js";
import settings from "./settings.js";
import storage from "./core/storage.js";
import { start } from "./main.js";
import {
INDEX_UPDATE_URL,
} from "./constants.js";
async function checkAutoUpdate() {
if (await settings.autoUpdate) {