I would like to create data on the user side and allow javascript from another URL to access it. I know about the same origin policy, but I was wondering if some exceptions could be created. Or is there a trick / feature that I could use?
The best trick I know is to use iframes and the postMessage API to access localStorage from an external domain.
postMessage
This technique is pretty simple:
Your data domain needs to listen to the message event:
message
document.addEventListener ("message", handler, useCapture);
the handler will be responsible for accessing localStorage and sending its contents to the source domain
localStorage
handler
To ensure the security of your data, you can use the X-Frame-Options ALLOW-FROM uri HTTP header https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options?redirectlocale=en-US&redirectslug= The_X-FRAME-OPTIONS_response_header
Hope this helps.
Source: https://habr.com/ru/post/953529/More articles:jQuery Mobile programmatically reinitializes / restarts the application - jquery-mobileTkinter: How to activate ttk.Radiobutton and get its value? - pythonConvert unsigned char * to uint64_t - cSession count is not saved - pythonWhy do two web pages have different local storage? How can i fix this? - javascriptType Inference with Reflection and DataKinds - reflectionCreating publication quality tables in python - pythonMonads and abstraction - haskellHow to create such a grid table using matplotlib - pythonDoes Google not cache my AJAX Crawlable app correctly? - javascriptAll Articles