2
A while ago I was looking for solutions to create temporary pages on the client side, today I found something similar in this post: How to edit an existing localStorage item in a blob url
However as I could see there is a limitation to remove information from the page in blob, because apparently the localStorage is restricted to page blob, tested cookies and are also.
Would have some other way to create temporary client-side pages without the need for a server?
function newBlob(text){
var blob = new Blob(["\ufeff", text], {type: "text/html"})
var url = window.URL.createObjectURL(blob)
return url
}
newBlob('HTML AQUI')
//retorna a url em BLOB
Using the API’s
ServiceWorker
,Cache
andResponse
vc can create client-side only pages, including adding unique features to these pages (CSS, Javascript, images, etc). The "laborious" part is to assemble all this structuring of pages on the client side and redo it (or not) whenever updating the cache.– Lauro Moraes
With the
ServiceWorker
I could extract information from the temporary page vialocalStorage
and access a common page?– Mark
With
ServiceWorker
a page created in the frontend would be treated as a "common" page... with all the resources available. What is stored in the page "created" (IndexedDB
,localStorage
,cookie
) can be "recovered" on other pages in the same domain.– Lauro Moraes