IndexedDB in iframe of ionic for iOS: Security error

I have an iframe in an Ionic 2 application. This iframe (different origin but I control both sides) uses indexedDB. I receive the error “ called in an invalid security context” when opening the database in the iframe on iOS. Note that it works on Android or on the web interface.

Is there anything I can do to make this work? I would like to avoid re-developing everything and just glue so that I can use my existing code in the iframe.