locked
Do the App and iframe in the app share the same IndexedDB? RRS feed

  • Question

  • Do the App and iframe in the app share the same IndexedDB?

     

    So for example, I have a WebApp in an iframe inside of my native Metro App. The WebApp uses IndexedDB or WebSQL database to store information. 

     

    So, is the IndexedDB that the iframe uses the same as the one that the native app uses?

     

    Do they have access to each others' data in the IndexedDB, given that they usually can't due to the Same-Origin Policy on browser?

     

    If yes, is there any examples that I can refer to?

     

    Thanks,


    • Edited by Louis_PiG Monday, January 30, 2012 4:45 PM
    Friday, January 27, 2012 7:29 AM

Answers

  • No they will use different contexts so they do not share the msIndexedDb object.

    Also you will see hitting the site with the WebBrowser and then pointing to the same URI in the WWA will result in not sharing.

    -Jeff


    Jeff Sanders (MSFT)
    Tuesday, January 31, 2012 7:45 PM
    Moderator
  • Hey Louis,

    It lives with the app.  I will not go away.  Give it a try!

    -Jeff


    Jeff Sanders (MSFT)
    • Marked as answer by Louis_PiG Wednesday, February 1, 2012 4:33 PM
    Wednesday, February 1, 2012 1:21 PM
    Moderator

All replies

  • Hi Louis,

    Can you expand on what you mean by storage and databases?  What are you trying to accomplish?

    -Jeff


    Jeff Sanders (MSFT)
    Monday, January 30, 2012 1:10 PM
    Moderator
  • Thank you Jeff. I updated the question. Please let me know if there is any other questions.

     

    Thanks,


    Louis
    Monday, January 30, 2012 4:45 PM
  • No they will use different contexts so they do not share the msIndexedDb object.

    Also you will see hitting the site with the WebBrowser and then pointing to the same URI in the WWA will result in not sharing.

    -Jeff


    Jeff Sanders (MSFT)
    Tuesday, January 31, 2012 7:45 PM
    Moderator
  • Thanks Jeff. 

     

    So how long does the data stays in the iframe's indexedDB? Are all the data gone as soon as the app is terminated?

     


    Louis
    Tuesday, January 31, 2012 10:32 PM
  • Hey Louis,

    It lives with the app.  I will not go away.  Give it a try!

    -Jeff


    Jeff Sanders (MSFT)
    • Marked as answer by Louis_PiG Wednesday, February 1, 2012 4:33 PM
    Wednesday, February 1, 2012 1:21 PM
    Moderator
  • So Jeff, that means the user has no control over the wwa context indexDBs? Specifically he cannot clear them using the Internet Options "Clear Cache and databases" operation?

    I understand correctly, the IndexDB for an app stays on the computer as long as the app is installed?

    Friday, February 17, 2012 6:34 PM