rust-search-extension/manifest.jsonnet

59 lines
2.8 KiB
Text
Raw Normal View History

2020-05-13 15:39:15 +00:00
local manifest = import 'core/manifest.libsonnet';
2020-09-07 11:38:08 +00:00
local utils = import 'core/utils.libsonnet';
2020-01-17 04:09:20 +00:00
local icons() = {
2020-05-12 13:45:04 +00:00
[size]: 'rust.png'
for size in ['16', '48', '128']
2020-01-17 04:09:20 +00:00
};
2020-05-13 15:39:15 +00:00
local json = manifest.new(
name='Rust Search Extension',
2021-12-27 15:35:53 +00:00
version='1.4.1',
2020-05-13 15:39:15 +00:00
keyword='rs',
2021-06-03 15:18:42 +00:00
description='Rust Search Extension - the ultimate search extension for Rust',
2020-05-13 15:39:15 +00:00
)
.addIcons(icons())
.addPermissions(['storage'])
.addWebAccessibleResources(utils.js_files('script', ['add-search-index']))
.addBackgroundScripts(['settings.js', 'deminifier.js'])
2021-02-21 03:32:49 +00:00
.addBackgroundScripts(utils.js_files('search', ['algorithm', 'book', 'crate', 'attribute', 'caniuse', 'lint']))
.addBackgroundScripts(utils.js_files('search/docs', ['base', 'std', 'crate-doc', 'rustc']))
2021-10-16 04:14:40 +00:00
.addBackgroundScripts(utils.js_files('index', ['attributes', 'books', 'caniuse', 'crates', 'std-docs', 'lints', 'labels', 'rfcs', 'commands']))
.addBackgroundScripts(utils.js_files('command', ['blog', 'label', 'help', 'stable', 'rfc']))
2021-07-03 16:25:53 +00:00
.addBackgroundScripts(['statistics.js', 'rust-version.js', 'crate-manager.js', 'index-manager.js', 'main.js'])
2020-05-13 15:39:15 +00:00
.addContentScript(
2020-05-13 15:53:22 +00:00
matches=['*://docs.rs/*'],
js=utils.js_files('script', ['lib', 'docs-rs', 'svgs', 'rust-src-navigate']) + utils.js_files('libs', ['semver']),
2020-05-13 15:53:22 +00:00
css=['script/docs-rs.css'],
2020-07-24 09:10:48 +00:00
)
.addContentScript(
matches=['*://doc.rust-lang.org/*'],
2021-02-21 04:17:50 +00:00
js=utils.js_files('script', ['lib', 'doc-rust-lang-org', 'rust-src-navigate']),
css=['script/doc-rust-lang-org.css'],
exclude_matches=['*://doc.rust-lang.org/nightly/nightly-rustc/*'],
)
2021-01-17 05:53:11 +00:00
.addContentScript(
matches=['*://doc.rust-lang.org/nightly/nightly-rustc/*'],
2021-02-21 04:17:50 +00:00
js=utils.js_files('script', ['lib', 'rustc', 'rust-src-navigate']),
css=[],
)
2021-01-17 05:53:11 +00:00
.addContentScript(
2021-03-26 15:01:54 +00:00
matches=['*://rust.extension.sh/update'],
js=utils.js_files('script', ['rust-extension-sh']),
css=[],
).addContentScript(
2021-01-17 05:53:11 +00:00
matches=['*://github.com/rust-lang/rust/blob/master/RELEASES.md*'],
js=utils.js_files('script', ['lib', 'rust-lang-release']),
css=['script/github.css'],
);
2020-06-05 03:19:56 +00:00
local browser = std.extVar('browser');
if browser == 'chrome' then
json {
description: 'A handy browser extension to search Rust docs and crates, etc in the address bar instantly!',
// The production extension public key to get the constant extension id during development.
key: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxOX+QfzcFnxPwwmzXDhuU59XGCSMZq+FGo0vOx/ufg/Vw7HfKEPVb9TKzrGtqW38kafWkjxOxGhF7VyyX2ymi55W0xqf8BedePbvMtV6H1tY5bscJ0dLKGH/ZG4T4f645LgvOWOBgyv8s3NDWXzwOMS57ER1y+EtHjDsWD1M0nfe0VCCLW18QlAsNTHfLZk6lUeEeGXZrl6+jK+pZxwhQFmc8cJvOyw7uAq6IJ9lnGDvxFVjGUepA0lKbLuIZjN3p70mgVUIuBYzKE6R8HDk4oBbKAK0HyyKfnuAYbfwVYotHw4def+OW9uADSlZEDC10wwIpU9NoP3szh+vWSnk0QIDAQAB',
}
2020-01-17 04:09:20 +00:00
else
json