Firefox redirects to url wyciwyg: // [closed]

0

After an Ajax call, return the html as a string and generate a new page with document.write() .

But when browsing this page, when using browser back or forward, page urls begin to come with wyciwyg (eg wyciwyg://4/http://localhost/ ), Firefox ends up directing to a page stored in wyciwyg ( what you cache is what you get ). The problem is that it is leaving this in the url, using the wyciwyg protocol and compromising the url.

This is a firefox bug in pages generated with document.write() .

    
asked by anonymous 03.12.2016 / 15:43

1 answer

0

I could not reproduce what happened with your code, I'm using Firefox 50 also, document.write just deletes the content of the page and rewrites, for example:

setInterval(function() {
    document.open();
    document.write("<strong>Resposta:<\/strong> " + (new Date()));
    document.close();
}, 1500);
<h1>Olá, mundo!</h1>

However, if this is what you want, you can change it to document.body.innerHTML that you might correct:

setInterval(function() {
    document.body.innerHTML = "<strong>Resposta:<\/strong> " + (new Date());
    document.close();
}, 1500);
<h1>Olá, mundo!</h1>
    
04.12.2016 / 04:59