I don't know, but I suspect it might help if you operated on the DOM 
instead of on the HTML directly. So if you selected the .innerText property 
of the text nodes that you wanted to change words in, rather than the HTML 
of the whole document.

On Sunday, 11 November 2018 22:17:57 UTC+1, Anton wrote:
>
> I need to replace all matches of one word by another.
> Here is how I did it:
>
> document.body.innerHTML = document.body.innerHTML.replace('/hello/gi', 
> 'world');
>
> When I enable my greaseMonkey scipt this page doesn't load correctly (it 
> appears empty):
> https://translate.yandex.ru/?text=hello&lang=en-ru
>
> When I disable my script the page loads correctly.
> What's wrong with my code?
>

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to