Spaces:
Runtime error
Runtime error
Update src/addons/addons/debug-console/userscript.js
Browse files
src/addons/addons/debug-console/userscript.js
CHANGED
|
@@ -8,28 +8,4 @@ export default async ({ addon, console, msg }) => {
|
|
| 8 |
};
|
| 9 |
document.body.appendChild(script);
|
| 10 |
}
|
| 11 |
-
|
| 12 |
-
// ボタン挿入処理をループで監視
|
| 13 |
-
while (true) {
|
| 14 |
-
const targetElem = await addon.tab.waitForElement(
|
| 15 |
-
'div[class*="menu-bar_file-group"] > div:last-child:not(.sa-record)',
|
| 16 |
-
{ markAsSeen: true }
|
| 17 |
-
);
|
| 18 |
-
|
| 19 |
-
if (!document.querySelector('.sa-eruda-button')) {
|
| 20 |
-
const erudaButton = document.createElement("div");
|
| 21 |
-
erudaButton.className = "sa-eruda-button " + targetElem.className;
|
| 22 |
-
erudaButton.textContent = "開発者ツール";
|
| 23 |
-
erudaButton.style.cursor = "pointer";
|
| 24 |
-
erudaButton.style.marginLeft = "10px";
|
| 25 |
-
|
| 26 |
-
erudaButton.addEventListener("click", () => {
|
| 27 |
-
if (window.eruda) {
|
| 28 |
-
eruda.show();
|
| 29 |
-
}
|
| 30 |
-
});
|
| 31 |
-
|
| 32 |
-
targetElem.parentElement.appendChild(erudaButton);
|
| 33 |
-
}
|
| 34 |
-
}
|
| 35 |
};
|
|
|
|
| 8 |
};
|
| 9 |
document.body.appendChild(script);
|
| 10 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
};
|