{"id":859,"date":"2026-11-20T15:00:04","date_gmt":"2026-11-20T15:00:04","guid":{"rendered":"https:\/\/html-editor-online.com\/blog?p=859"},"modified":"2026-11-20T15:00:04","modified_gmt":"2026-11-20T15:00:04","slug":"localstorage-securityerror-sandboxed-html-preview","status":"publish","type":"post","link":"https:\/\/html-editor-online.com\/blog\/localstorage-securityerror-sandboxed-html-preview\/","title":{"rendered":"localStorage SecurityError in a Sandboxed HTML Preview: Why It Happens"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If your script throws a <code>SecurityError<\/code> the moment it touches <code>localStorage<\/code>, the cause is almost certainly the preview sandbox and not a typo. In the <a href=\"https:\/\/html-editor-online.com\/editors\/html\" title=\"HTML Code Editor - Free Online HTML Editor | HTML Editor Online\">HTML Code Editor<\/a>, the live preview runs your inline scripts inside a sandboxed iframe that cannot use cookies or <code>localStorage<\/code>. That makes a localStorage SecurityError in a sandboxed HTML preview expected behavior. The editor can still save your draft, because that happens in the editor&#8217;s own page, which is a different context from the preview.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This article starts from a small HTML page with an inline script and ends with a visible result you can trust. You will run a storage-free test, catch the error and display its name, tell the failure apart from a syntax error, and then check real persistence where the page will actually be deployed.<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li class=\"\"><a href=\"#why-a-localstorage-securityerror-appears-in-a-sandboxed-html-preview-1\">Why a localStorage SecurityError appears in a sandboxed HTML preview<\/a><\/li><li class=\"\"><a href=\"#why-the-editor-can-save-a-draft-but-your-preview-script-cannot-2\">Why the editor can save a draft but your preview script cannot<\/a><\/li><li class=\"\"><a href=\"#run-a-storage-free-test-script-first-3\">Run a storage-free test script first<\/a><\/li><li class=\"\"><a href=\"#separating-a-localstorage-securityerror-in-a-sandboxed-html-preview-from-a-syntax-error-4\">Separating a localStorage SecurityError in a sandboxed HTML preview from a syntax error<\/a><\/li><li class=\"\"><a href=\"#test-real-persistence-where-the-page-will-be-deployed-5\">Test real persistence where the page will be deployed<\/a><\/li><li class=\"\"><a href=\"#what-not-to-do-when-the-sandbox-blocks-storage-6\">What not to do when the sandbox blocks storage<\/a><\/li><li class=\"\"><a href=\"#frequently-asked-questions\">Frequently asked questions<\/a><\/li><li class=\"\"><a href=\"#next-steps\">Next steps<\/a><\/li><li class=\"\"><a href=\"#sources\">Sources and further reading<\/a><\/li><\/ul><\/nav><\/div>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-1-815-1-cafb175de6f86a8f-1024x576.jpg\" alt=\"Glass box around a small browser window with a locked storage cabinet outside it, representing a sandboxed preview\" class=\"wp-image-863\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-1-815-1-cafb175de6f86a8f-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-1-815-1-cafb175de6f86a8f-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-1-815-1-cafb175de6f86a8f-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-1-815-1-cafb175de6f86a8f.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"why-a-localstorage-securityerror-appears-in-a-sandboxed-html-preview-1\">Why a localStorage SecurityError appears in a sandboxed HTML preview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The error looks alarming, but the cause is a rule about origins, not about your code. According to the HTML Code Editor page, which I checked on November 15, 2026, the live preview renders your HTML in a sandboxed <code>srcdoc<\/code> iframe. Inline scripts run there. Cookies and <code>localStorage<\/code> are not available to preview code, and reading <code>localStorage<\/code> throws a <code>SecurityError<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The standard describes the mechanism. In the <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/browsers.html\" title=\"HTML Standard\" target=\"_blank\" rel=\"noopener\">WHATWG HTML Living Standard<\/a>, the <code>allow-scripts<\/code> sandbox keyword permits script execution, while leaving out <code>allow-same-origin<\/code> gives the sandboxed document an opaque origin. That opaque origin blocks <code>localStorage<\/code> and <code>document.cookie<\/code>. The <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/webstorage.html\" title=\"HTML Standard\" target=\"_blank\" rel=\"noopener\">Web Storage section of the standard<\/a> says the <code>localStorage<\/code> getter throws a <code>SecurityError<\/code> <code>DOMException<\/code> when the origin is opaque. Both sections were last updated November 14, 2026.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One detail trips people up: the exception fires when the property is read, not only when you call <code>setItem()<\/code>. Evaluating the global <code>localStorage<\/code> identifier invokes the getter, so each of these can throw inside the preview before any storage call happens:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>const store = window.localStorage;<\/code><\/li>\n\n\n\n<li><code>if (localStorage) { ... }<\/code><\/li>\n\n\n\n<li>A bare <code>typeof localStorage<\/code>, because evaluating the identifier is enough to invoke the getter. It is not a safe feature check in the preview.<\/li>\n\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That means a feature check written as a plain <code>if<\/code> or <code>typeof<\/code> can crash before your fallback branch runs. Every reference to <code>localStorage<\/code>, including the check itself, has to live inside <code>try<\/code> and <code>catch<\/code>.<\/p>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-2-815-2-72b3d4b8a9aeda83-1024x576.jpg\" alt=\"Two separate rooms showing the editor saving a draft while the preview room stays sealed\" class=\"wp-image-865\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-2-815-2-72b3d4b8a9aeda83-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-2-815-2-72b3d4b8a9aeda83-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-2-815-2-72b3d4b8a9aeda83-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-2-815-2-72b3d4b8a9aeda83.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"why-the-editor-can-save-a-draft-but-your-preview-script-cannot-2\">Why the editor can save a draft but your preview script cannot<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It seems contradictory that the same page can store a draft and still throw a storage error. The two behaviors come from different execution contexts. The editor page saves your code in its own <code>localStorage<\/code>, automatically every two minutes or when you save. Your HTML runs in a separate sandboxed iframe, and the editor&#8217;s ability to write a draft does not grant storage access to scripts inside that iframe.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Context<\/th><th>What runs there<\/th><th>Storage behavior<\/th><\/tr><\/thead><tbody><tr><td>Editor page<\/td><td>The editor&#8217;s own code<\/td><td>Saves your draft to its own localStorage, every two minutes or on save<\/td><\/tr><tr><td>Preview iframe<\/td><td>Your HTML and inline scripts<\/td><td>No cookies or localStorage; reading localStorage throws SecurityError<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Two practical consequences follow. First, your preview script cannot read the saved draft, and it should not try to. Second, a working autosave tells you nothing about whether your own storage code will work. Saved drafts are also tied to the browser and profile that stored them, which is why you can read about a <a href=\"https:\/\/html-editor-online.com\/blog\/browser-html-editor-draft-missing-incognito-different-browser\/\" title=\"Browser HTML Editor Draft Missing in Incognito or a Different Browser: Why and What to Do\">browser HTML editor draft missing in incognito or a different browser<\/a> when a draft seems to vanish.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to understand when a keyboard shortcut writes a draft and when it downloads a file, there is a separate explanation of <a href=\"https:\/\/html-editor-online.com\/blog\/ctrl-s-browser-code-editor-save-or-download-file\/\" title=\"Ctrl+S in a Browser Code Editor: Does It Save or Download a File?\">whether Ctrl+S saves or downloads a file in a browser code editor<\/a>. Neither behavior changes what the preview iframe is allowed to do.<\/p>\n\n\n<div class=\"wp-block-image heo-auto-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-3-815-3-ae72f204a97813b1-1024x576.jpg\" alt=\"Developer watching a simple confirmation appear in a browser preview after running a small script\" class=\"wp-image-867\" srcset=\"https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-3-815-3-ae72f204a97813b1-1024x576.jpg 1024w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-3-815-3-ae72f204a97813b1-300x169.jpg 300w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-3-815-3-ae72f204a97813b1-768x432.jpg 768w, https:\/\/html-editor-online.com\/blog\/wp-content\/uploads\/2026\/11\/localstorage-securityerror-sandboxed-html-preview-image-3-815-3-ae72f204a97813b1.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"run-a-storage-free-test-script-first-3\">Run a storage-free test script first<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you debug storage, prove that scripts run at all. The test below writes its result into the page, so you do not need pop-ups or developer tools. The input is a short HTML document, and the expected output is the text <code>Script ran: 4<\/code> replacing <code>Waiting...<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;p id=&quot;result&quot;&gt;Waiting...&lt;\/p&gt;\n&lt;script&gt;\n  document.getElementById(&quot;result&quot;).textContent = &quot;Script ran: &quot; + (2 + 2);\n&lt;\/script&gt;<\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the HTML Code Editor and replace the starting markup with the snippet above.<\/li>\n\n\n\n<li>Wait for the live preview to update.<\/li>\n\n\n\n<li>Read the paragraph. If it says <code>Script ran: 4<\/code>, the script executed and does not depend on storage.<\/li>\n\n\n\n<li>If it still says <code>Waiting...<\/code>, the script did not run, and the problem is something other than storage.<\/li>\n\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The script sits after the paragraph on purpose, so the element exists when <code>getElementById<\/code> runs. The result uses <code>textContent<\/code> instead of <code>innerHTML<\/code>, which keeps the example free of markup injection. For another workflow that pairs a preview with scripts, see the guide to a <a href=\"https:\/\/html-editor-online.com\/blog\/markdown-javascript-editor-browser\/\" title=\"Markdown JavaScript Editor in the Browser: Write Markdown, Preview HTML and Test Scripts\">Markdown JavaScript editor in the browser<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"separating-a-localstorage-securityerror-in-a-sandboxed-html-preview-from-a-syntax-error-4\">Separating a localStorage SecurityError in a sandboxed HTML preview from a syntax error<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once you know scripts run, add a separate storage attempt. Wrapping it in <code>try<\/code> and <code>catch<\/code> lets the page report the error name instead of failing quietly:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"html\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;p id=&quot;storage-result&quot;&gt;Checking storage...&lt;\/p&gt;\n&lt;script&gt;\n  const output = document.getElementById(&quot;storage-result&quot;);\n  try {\n    localStorage.setItem(&quot;demo-key&quot;, &quot;demo-value&quot;);\n    output.textContent = &quot;Stored: &quot; + localStorage.getItem(&quot;demo-key&quot;);\n  } catch (error) {\n    output.textContent = &quot;Storage failed: &quot; + error.name;\n  }\n&lt;\/script&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In this preview, the paragraph should read <code>Storage failed: SecurityError<\/code>. That output confirms a runtime exception thrown by the sandbox. Your syntax was fine, because the script parsed and the <code>catch<\/code> block executed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A syntax error behaves differently. Consider this line:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">const total = ;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The engine rejects it while parsing, so the affected script never starts. Nothing in it runs, including any <code>try<\/code> block, and your visible message stays at its initial text. The checks are separate:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Syntax error:<\/strong> the script does not run at all, so the page keeps its starting text.<\/li>\n\n\n\n<li><strong>Runtime exception such as SecurityError:<\/strong> the script starts, then fails at one operation, and a <code>catch<\/code> block can still display a message.<\/li>\n\n\n\n<li><strong>Editor highlighting:<\/strong> the HTML Code Editor does not lint or validate code, so clean coloring is not evidence that a script is correct or that storage will work.<\/li>\n\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Do not describe a <code>SecurityError<\/code> as a highlighting or HTML validation result. It comes from the browser&#8217;s runtime rules for the preview&#8217;s origin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"test-real-persistence-where-the-page-will-be-deployed-5\">Test real persistence where the page will be deployed<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The preview result cannot tell you whether storage will work on your finished site. For a real persistence test, serve the page from the origin where it will live, then follow this sequence:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Load the page and call <code>localStorage.setItem()<\/code> with a harmless fictitious value.<\/li>\n\n\n\n<li>Read it back with <code>getItem()<\/code> and display the value in the page.<\/li>\n\n\n\n<li>Reload the page and read the value again.<\/li>\n\n\n\n<li>Confirm the value is still there after the reload.<\/li>\n\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Keep every access inside <code>try<\/code> and <code>catch<\/code>, because browser settings or policy can also deny storage on a normal page. A small helper keeps the fallback in one place:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">function readSetting(key) {\n  try {\n    return localStorage.getItem(key);\n  } catch (error) {\n    return null;\n  }\n}\n\nconst theme = readSetting(&quot;theme&quot;) || &quot;light&quot;;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">MDN, last modified October 12, 2026, describes <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/localStorage\" title=\"Window: localStorage property - Web APIs | MDN\" target=\"_blank\" rel=\"noopener\">localStorage<\/a> as specific to an origin and persistent across ordinary browser sessions. It also notes that behavior for <code>file:<\/code> URLs is undefined and may vary, so opening a local HTML file is not a dependable deployment test.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/html-editor-online.com\/editors\/javascript\" title=\"JavaScript Editor\">JavaScript Editor<\/a> can run code in the browser and show synchronous console output, which suits quick logic checks. Do not treat it as a persistence test, because it runs on the editor&#8217;s page and not on your site&#8217;s origin, and only run code you trust.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-not-to-do-when-the-sandbox-blocks-storage-6\">What not to do when the sandbox blocks storage<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Do not try to bypass the preview sandbox. The HTML standard warns that combining <code>allow-scripts<\/code> and <code>allow-same-origin<\/code> on an iframe that holds same-origin content can let that content break out of its sandbox after a reload, and the restriction exists for good reason. You also cannot change the editor&#8217;s sandbox from your own markup.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you only need to demonstrate a feature that normally saves data, keep the value in a plain JavaScript variable and show it on the page. It will reset whenever the preview reloads, so treat it as a visual stand-in and not as persistence. Avoid promising that storage works regardless of browser privacy settings, and never imply that the preview can read the editor&#8217;s saved draft.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"frequently-asked-questions\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-1\">Does a SecurityError mean my JavaScript has a syntax mistake?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. A syntax error stops a script from running at all. A SecurityError is a runtime exception raised when the script touches storage the sandboxed preview does not allow. If your catch block can display the error name, the script parsed and ran.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-2\">Why can the editor save my draft while my preview script cannot use localStorage?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">They run in different contexts. The editor page saves the draft in its own localStorage, automatically every two minutes or when you save. Your code runs in a sandboxed iframe with an opaque origin, so the editor&#8217;s storage ability does not carry over.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-3\">Can my preview script read the draft the editor saved?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No, and you should not expect it to. The draft belongs to the editor&#8217;s own page. The preview is a separate sandboxed context, and reading localStorage there throws a SecurityError.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-4\">Do cookies or sessionStorage work in the preview?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The HTML Code Editor page says preview code cannot use cookies or localStorage. It does not document sessionStorage, so do not rely on it. Wrap any storage access in try and catch, and test on your deployed page.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-5\">Will my storage code work after I deploy the page?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Often yes, but the preview cannot prove it. Serve the page from its intended origin, call setItem and getItem, reload, and check the value. Keep storage access in try and catch, because browser settings or policy can also deny it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-6\">Can I test persistence by opening a local HTML file?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">I would not rely on it. MDN notes that localStorage behavior for file: URLs is undefined and may vary. A page served from the intended origin gives a far more reliable result.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"faq-7\">How can I demo a feature that normally saves data inside the preview?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Store the value in a regular variable and write it into the page with textContent. It will reset when the preview reloads, so it only illustrates the interface. Real persistence needs a separate test on the deployed origin.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps\">Next steps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A localStorage SecurityError in a sandboxed HTML preview describes a restriction on the preview iframe, not a mistake in your JavaScript syntax. Confirm the script runs with the visible storage-free test, use <code>try<\/code> and <code>catch<\/code> to display <code>error.name<\/code>, and keep syntax errors, runtime exceptions and deployment behavior as separate checks. As a next step, paste the storage-free snippet into the HTML Code Editor, then serve your finished page from its intended origin and verify the stored value survives a reload.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Related tools and resources on HTML Editor Online:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/html-editor-online.com\/editors\/html\">HTML Code Editor<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/editors\/javascript\">JavaScript Editor<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\/browser-html-editor-draft-missing-incognito-different-browser\/\">Browser HTML Editor Draft Missing in Incognito or a Different Browser: Why and What to Do<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\/ctrl-s-browser-code-editor-save-or-download-file\/\">Ctrl+S in a Browser Code Editor: Does It Save or Download a File?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html-editor-online.com\/blog\/markdown-javascript-editor-browser\/\">Markdown JavaScript Editor in the Browser: Write Markdown, Preview HTML and Test Scripts<\/a><\/li>\n\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"sources\">Sources and further reading<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/html-editor-online.com\/editors\/html\">HTML Code Editor &#8211; Free Online HTML Editor | HTML Editor Online<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/browsers.html\" target=\"_blank\" rel=\"noopener\">HTML Standard<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/webstorage.html\" target=\"_blank\" rel=\"noopener\">HTML Standard<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/html.spec.whatwg.org\/multipage\/iframe-embed-object.html\" target=\"_blank\" rel=\"noopener\">HTML Standard<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/localStorage\" target=\"_blank\" rel=\"noopener\">Window: localStorage property &#8211; Web APIs | MDN<\/a><\/li>\n\n\n<\/ul>\n\n\n","protected":false},"excerpt":{"rendered":"<p>A localStorage SecurityError in a sandboxed HTML preview is a restriction, not a bug in your code. Learn how to confirm that and test storage properly.<\/p>\n","protected":false},"author":1,"featured_media":862,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[273,116,266,272,274,218,271],"class_list":["post-859","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html-editor","tag-browser-storage","tag-html-code-editor","tag-html-live-preview","tag-iframe-sandbox","tag-javascript-debugging","tag-localstorage","tag-securityerror"],"_links":{"self":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/comments?post=859"}],"version-history":[{"count":5,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/859\/revisions"}],"predecessor-version":[{"id":868,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/posts\/859\/revisions\/868"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/media\/862"}],"wp:attachment":[{"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/media?parent=859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/categories?post=859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html-editor-online.com\/blog\/wp-json\/wp\/v2\/tags?post=859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}