How to create temporary pages on the customer side?

Asked

Viewed 92 times

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

  • 3

    Using the API’s ServiceWorker, Cache and Response 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.

  • With the ServiceWorker I could extract information from the temporary page via localStorage and access a common page?

  • 1

    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.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.