Search code examples
htmlsafarireload

Apple Safari keep html changes after page reload


I am using the web inspector in Apple Safari browser to alter the html code of a website in Safari. Is there any way to keep the changes after reload of the page?

I want to add reload button in a specific part of the page. I don't have problem with that but I want the button to stay there after reload.


Solution

  • Apple Safari keep html changes after page reload

    Every web browser, when it reloads a page, always resets the HTML to its original and re-executes any JavaScript code.

    I am using the web inspector in Apple Safari browser to alter the html code of a website in Safari.

    What you've changed is the rendered page in the web browser. You're changing in-memory data in your computer, not the HTML file.

    Is there any way to keep the changes after reload of the page?

    No. You'll have to edit the HTML file separately. With the default web browser features, the closest thing you can do is by using HTML/JS playgrounds such as JSFiddle or JSBin.

    However, you can create a HTML application similar to JSFiddle, but you won't be editing the HTML file directly.

    Not sure if there is a Safari equivalent - but there is Emmet LiveStyle for Chrome - https://chrome.google.com/webstore/detail/emmet-livestyle/diebikgmpmeppiilkaijjbdgciafajmg?hl=en

    You'd be better off editing the actual file itself, though - and last time I tried LiveStyle I seem to recall it wasn't overly stable.