mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 15:47:12 +00:00
Only load macro railroad wasm file in macro pages
This commit is contained in:
parent
f3b73a4316
commit
b6ad08a182
1 changed files with 4 additions and 1 deletions
|
@ -5,10 +5,13 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|||
async function load() {
|
||||
if (!isRustDoc()) return;
|
||||
|
||||
let macros = document.querySelectorAll('pre.macro');
|
||||
if (!macros || macros.length === 0) return;
|
||||
|
||||
await wasm_bindgen(chrome.runtime.getURL('wasm/macro-railroad.wasm'));
|
||||
injectCss();
|
||||
|
||||
for (let macro of document.querySelectorAll('pre.macro')) {
|
||||
for (let macro of macros) {
|
||||
let parentNode = macro.parentNode;
|
||||
if (!parentNode) continue;
|
||||
|
||||
|
|
Loading…
Reference in a new issue