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',
|
2020-10-31 02:49:53 +00:00
|
|
|
version='1.0.0',
|
2020-05-13 15:39:15 +00:00
|
|
|
keyword='rs',
|
|
|
|
description='The ultimate search extension for Rust',
|
|
|
|
)
|
|
|
|
.addIcons(icons())
|
2020-10-27 09:58:15 +00:00
|
|
|
.addPermissions(['storage'])
|
2020-09-09 09:29:01 +00:00
|
|
|
.addWebAccessibleResources(['script/add-search-index.js', 'script/add-std-search-index.js'])
|
2020-10-22 08:40:27 +00:00
|
|
|
.addBackgroundScripts(['settings.js', 'deminifier.js'])
|
2020-10-02 22:19:51 +00:00
|
|
|
.addBackgroundScripts(utils.js_files('search', ['book', 'crate', 'attribute', 'caniuse', 'lint']))
|
2020-09-09 10:50:24 +00:00
|
|
|
.addBackgroundScripts(utils.js_files('search/docs', ['base', 'std', 'crate-doc']))
|
2020-10-02 22:19:51 +00:00
|
|
|
.addBackgroundScripts(utils.js_files('index', ['attributes', 'books', 'caniuse', 'crates', 'std-docs', 'lints', 'labels', 'commands']))
|
2020-11-25 15:16:40 +00:00
|
|
|
.addBackgroundScripts(utils.js_files('command', ['release', 'label', 'help', 'stable', 'update']))
|
2020-10-13 04:09:36 +00:00
|
|
|
.addBackgroundScripts(['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/*'],
|
2020-09-23 10:29:17 +00:00
|
|
|
js=utils.js_files('script', ['lib', 'docs-rs', 'svgs']) + 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/nightly/std/*'],
|
2020-09-09 09:29:01 +00:00
|
|
|
js=utils.js_files('script', ['lib', 'doc-rust-lang-org']),
|
|
|
|
css=[],
|
|
|
|
).addContentScript(
|
|
|
|
matches=['*://doc.rust-lang.org/std/*', '*://doc.rust-lang.org/stable/std/*'],
|
|
|
|
js=utils.js_files('script', ['lib', 'doc-rust-lang-org']),
|
2020-07-24 09:10:48 +00:00
|
|
|
css=[],
|
2020-10-22 05:44:04 +00:00
|
|
|
).addContentScript(
|
2020-10-22 08:40:27 +00:00
|
|
|
matches=['*://rust.extension.sh/update', '*://extension.sh/update/'],
|
|
|
|
js=utils.js_files('script', ['rust-extension-sh']),
|
|
|
|
css=[],
|
2020-11-25 15:09:20 +00:00
|
|
|
).addContentScript(
|
2020-12-19 10:28:34 +00:00
|
|
|
matches=['*://github.com/rust-lang/rust/blob/master/RELEASES.md*'],
|
2020-11-25 15:09:20 +00:00
|
|
|
js=utils.js_files('script', ['lib', 'rust-lang-release']),
|
2020-11-29 12:40:04 +00:00
|
|
|
css=['script/github.css'],
|
2020-10-22 08:40:27 +00:00
|
|
|
);
|
2020-01-16 12:30:14 +00:00
|
|
|
|
2020-06-05 03:19:56 +00:00
|
|
|
local browser = std.extVar('browser');
|
2020-10-22 08:40:27 +00:00
|
|
|
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
|
2020-10-22 08:40:27 +00:00
|
|
|
json
|