How to edit an existing localStorage item in a blob HTML page?
The item comes from another page and is replaced on the blob page, but when you try to replace the item, you end up creating a new one accessible only within the blob page. Unable to access from browser console. Is it possible to edit the "external" item in a blob page?
//create a new item in localStorage
localStorage.setItem("test", "not working")
//create a blob url
function newBlob(text){
var blob = new Blob(["\ufeff", text], {type: "text/html"})
var url = window.URL.createObjectURL(blob)
return url
}
//give a content to the blob and return the url
window.location.href = newBlob(`<button onclick="localStorage.setItem('test', 'working')">Click here to replace the item</button>`)
//the button is here to replace the item but is actually creating a new one that can only be accessed within the blob