Forum Discussion

ThibaudGD's avatar
ThibaudGD
Frequent Visitor
3 years ago
Solved

Custom Visual - Can't open IDBFactory

Hello everyone,

 

I'm working on a custom visual that required to open IDBFactory (see this post from StackOverflow).
I can't figure out how to allow this. Is it possible ?

 

Here is the error message I got :

 

 

Uncaught DOMException: Failed to execute 'open' on 'IDBFactory': access to the Indexed Database API is denied in this context.
    at LocalDbCache.open (blob:null/470f8c49-3614-4d49-a0b7-c7a9c2553485:7363:29)
    at Object.doInitGeomWorker [as doOperation] (blob:null/470f8c49-3614-4d49-a0b7-c7a9c2553485:14896:18)
    at WorkerMain.dispatch (blob:null/470f8c49-3614-4d49-a0b7-c7a9c2553485:14477:12)
    at blob:null/470f8c49-3614-4d49-a0b7-c7a9c2553485:41771:55

 

 

 

Thank you all

  • Hi ThibaudGD,

    From the looks of things, this requires access to the browser data storage APIs. As the custom visual iframe sandbox does not have the allow-same-origin attribute set, I don't think this will not be possible to achieve. If you want definitive confirmation you may need to contact the custom visuals team for clarification - [email protected].

    Regards,

    Daniel

13 Replies

  • dm-p's avatar
    dm-p
    Super User

    Hi ThibaudGD,

    From the looks of things, this requires access to the browser data storage APIs. As the custom visual iframe sandbox does not have the allow-same-origin attribute set, I don't think this will not be possible to achieve. If you want definitive confirmation you may need to contact the custom visuals team for clarification - [email protected].

    Regards,

    Daniel

    • ThibaudGD's avatar
      ThibaudGD
      Frequent Visitor

      Hi dm-p,

       

      thank you for the answer. I just email them to have confirmation.

      In the meantime, do you know if there is any workaround to this ?

      • dm-p's avatar
        dm-p
        Super User

        If you want to use something that is not permitted by the sandbox, I would say it's not directly possible to work around. I don't know the IDBFactory APIs but if it's possible to access something similar from a remote endpoint that doesn't have CORS restrictions (again, a limitation of the allow-same-origin not being set by Power BI), then that might work. MS will not apply allow-same-origin to the sandbox as it effectively removes permissions from the sandbox, which creates all kind sof potential issues with custom visuals (even if your intentions are honourable).

        The only storage a visual has (unless you can get it submitted to AppSource, certified and whitelisted to use the custom visuals local storage API) is the visual properties.

    • wonderkid88's avatar
      wonderkid88
      Frequent Visitor

      Hey there, I'm facing the same issue and was wondering if you had luck applying 'disableIndexedDb=true' and also where did you apply it in the code?

       

      Thanks!

      • ThibaudGD's avatar
        ThibaudGD
        Frequent Visitor

        Hey,
        Saddly not. I used x-ads-derivative-format: fallback to get svf1 id in my requests.

  • ThibaudGD's avatar
    ThibaudGD
    Frequent Visitor

    I got the response from pbivsupport:

     


    Unfortunately right now it is impossible to use stuff like indexDB from our side.


    Thank you for the answers