Answer the question
In order to leave comments, you need to log in
How can I change the browser extension settings myself?
https://chrome.google.com/webstore/detail/x%CE%BBl...
Here is an extension for Chrome, can I somehow change which words to replace with my own? The extension file is located in the %localappdata%\Google\Chrome\User Data\Default\Extensions folder. I found the replace.js file there, but if you replace the text there, the extension continues to work as it was. How to make the changes in the extension file applied?
var doFilter = function(textNode) {
textNode.data = textNode.data.replace('Васи', 'Лоха');
textNode.data = textNode.data.replace('Вася', 'Лох');
textNode.data = textNode.data.replace('Васи', 'Лох');
textNode.data = textNode.data.replace('Васька', 'Лох');
}
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.addedNodes) {
[].slice.call(mutation.addedNodes).forEach(function(node) {
if (node.nodeName.toLowerCase() == "#text") {
doFilter(node);
}
});
}
});
});
observer.observe(document, {
childList: true,
subtree: true
});```
Answer the question
In order to leave comments, you need to log in
1) Copy the extension folder (for example, to the desktop)
2) Edit the replace.js file:
var doFilter = function(textNode) {
textNode.data = textNode.data.replace('legatobrown', 'legatobrown_лох');
}
3) Go to extensions and turn on developer mode Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question