Closed tafelnl closed 4 years ago
Top-level as in top-level context. This has nothing to do with the JavaScript framework. Could it be that you somehow try to run this in a framed context?
Thanks for your answer. I might not understand top-level context correctly. I will dive deeper into this and come back when I can grasp the concept a little better.
Closing the issue for now. If you have any further issues with the API not working on Chrome please file a bug using crbug.com and using the component Blink > Contacts
When I use this API top-level without any framework it works like a charm. But when I try to use it in Vue.js navigator.contacts is undefined.
If I understand the docs correctly, I think this is as intended:
But I cannot understand why one would make it work only from "top-level contexts". Can someone elaborate on that please?
Since many websites to date are SPA's based on either Angular, React or Vue, it seems pretty awkward and inefficient to make it work this way.
Edit: I am testing on a recent Android Chrome browser by the way