w3c / contact-picker

Contact Picker API
https://www.w3.org/TR/contact-picker/
Other
74 stars 8 forks source link

[QUESTION] Why is the API not working in Vue.js #32

Closed tafelnl closed 4 years ago

tafelnl commented 4 years ago

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:

Furthermore, The API will only be available from secure top-level contexts.

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

tomayac commented 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?

tafelnl commented 4 years ago

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.

rayankans commented 4 years ago

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