RE “I noticed that there is an issue were the URL isn’t always correctly posted to the input field.”
affected repos
Issue
This is is a race-condition bug in the /add page which affects all browser extensions and the iOS share sheet. When the /add page view is mounted, window.addEventListener('message', insertUrl) is created which listens for postMessages to populate the default value of the input field.
In theory, when the browser extension window, or the share sheet is open, it’ll send an input value via a postmessage. But the input still appears empty
Possible cause
the /add page is reloaded or updated to load the current kinopio user. This process refreshes or clears the input.
Possible resolution
If that’s the cause, is there a more reliable, non-time/event based method that the parent browser and ios share extension can send a message to the iframe?
e.g. maybe by setting a default navigator value or some other global that can be read and set by the /add page whenever it’s ready? The transmission mechanism should ideally be supported by iframes both in a browser extension context and app.
Ship updates for
the /add page,
browser-extensions for all platforms (see readme: firefox and chrome are almost the same, and there’s steps for building the safari from the firefox one). There are also instructions on how to submit to each app store, and i’ll send you the credentials for that or just update the repo and i can do that part
ios app,
and ‘Add to Kinopio’ mac safari extension app (see readme in browser-extensions) will need to be updated
I think if the problem is that the /add page is reloaded or updated, we would have to store the URL in localStorage so it survives a reload.
From the app side of things, that wouldn’t be an issue. AFAIK this should also work for iFrames because they have access to the local storage of their domain.