Spaces:
Running
Running
File size: 990 Bytes
dafa792 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
document.addEventListener('DOMContentLoaded', function () {
// Select the target node (the element you want to observe for changes)
const targetNode = document.body; // Or use any specific element you want to observe
// Create a new MutationObserver instance
const observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
// Look for all instances of the Copy button
const copyButtons = document.querySelectorAll(
'.MuiStack-root .MuiButtonBase-root[aria-label="Copy"]'
);
copyButtons.forEach(function (copyButton) {
// Hide each Copy button found
if (copyButton) {
copyButton.style.display = 'none';
}
});
});
});
// Define the configuration for the observer (what types of mutations to observe)
const config = { childList: true, subtree: true };
// Start observing the target node for configured mutations
observer.observe(targetNode, config);
});
|