Skip to content

Instantly share code, notes, and snippets.

@XenocodeRCE
Created March 3, 2024 17:58
Show Gist options
  • Select an option

  • Save XenocodeRCE/fa91407baee12955a6b7182028865832 to your computer and use it in GitHub Desktop.

Select an option

Save XenocodeRCE/fa91407baee12955a6b7182028865832 to your computer and use it in GitHub Desktop.
Récupérer le contenu KnowUnity
// content.js
function modifyHTML() {
// Remove blur effect from elements with class "hkxSCF"
const blurElements = document.querySelectorAll('.hkxSCF');
blurElements.forEach((element) => {
element.style.filter = 'none';
});
// Remove elements with class "action" and style "display: block"
const actionElements = document.querySelectorAll('.action');
actionElements.forEach((actionElement) => {
actionElement.remove();
});
// Remove element with XPath /html/body/div/main/div/div/div[1]/div[1]/div
const elementToRemove = document.evaluate('/html/body/div/main/div/div/div[1]/div[1]/div', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if (elementToRemove) {
elementToRemove.remove();
}
console.log('done.');
}
// Ensure the DOM content is fully loaded before running the modification
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', modifyHTML);
} else {
modifyHTML();
}
{
"manifest_version": 2,
"name": "KnowUnity Free",
"version": "1.0",
"permissions": ["activeTab"],
"browser_action": {
"default_icon": "icon.png"
},
"content_scripts": [
{
"matches": ["https://knowunity.fr/*"],
"js": ["content.js"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment