Reputation: 528
I am trying to handover a string from GAS_web_app_A to GAS_web_app_B. GAS_web_app_B gets launched from a button on GAS_web_app_A's UI.
As localStorage is supposed to be accessible across the same origin, I stored 'stuff' from GAS_web_app_A and tried to read it from GAS_web_app_B - in the same browser - chrome.
But GAS_web_app_B is not able to read this 'stuff' stored by GAS_web_app_A.
1) do all google app scripts that are deployed as a web apps get resolved by browser's localStorage as being from the same origin?
step 1 : launch GAS_web_app_A via its URL - https: //script.google.com/a/macros/XXXX.com/s//dev
step 2 : localStorage.setItem("stuff", stuff);
step 3 : launch GAS_web_app_B via its URL - https: //script.google.com/a/macros/XXXX.com/s//dev (from GAS_web_app_A)
step 4 : console.log( 'stuff is ' + localStorage.getItem("stuff") );
I always get null in step 4. ( I am able to retrieve 'stuff' from GAS_web_app_A even after a reload though... )
Is this supposed to work or am I missing something trivial?
Upvotes: 0
Views: 448
Reputation: 19835
absolutely not supposed to work. it would be a huge security issue. look into passing url parameters to the 2nd script.
Upvotes: 1