插件代码:
- <div>(() => {
- const normalize = (text) => (text || '').replace(/\s+/g, '')
- const apply = () => {
- document
- .querySelectorAll('#admin-user .actions button, #admin-user .actions [role="button"]')
- .forEach((button) => {
- if ([ '删除', 'Delete' ].includes(normalize(button.textContent))) {
- button.style.setProperty('display', 'none', 'important')
- }
- })
- }
- const start = () => {
- apply()
- new MutationObserver(apply).observe(document.body, {
- childList: true,
- subtree: true,
- })
- }
- if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', start, { once: true })
- } else {
- start()
- }
- })()</div>
复制代码
|