browser widget, URLs and Single Page Apps (SPA)

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rodneyt
Posts: 128
Joined: Wed Oct 17, 2018 7:32 am

browser widget, URLs and Single Page Apps (SPA)

Post by rodneyt » Wed Oct 17, 2018 7:51 am

After many (!) years away from Livecode (and before LiveCode, with RunTime Revolution, Metacard, and Hypercard) I'm taking a fresh look at the latest release.

I've been testing browser widget with our OB3 web application, which is a single page app (SPA), client-side heavy javascript app. The app allows users to browse course content pages, as user opens pages the browser URL is updated so that browser history will work (e.g. user navigates back/forwards with browser buttons, will navigate through content user has viewed - but in fact the user never leaves our SPA.

Our app loads fine in the browser widget. But I am unable to detect page changes, or to get the current URL

So if for example user is viewing page: DOMAIN/#/28078b33-a2b9-11e4-8ef9-000000000000/
put the URL of widget "ob3" will return DOMAIN (sorry, can't post URLs in this forum post editor, sigh)

Has anyone out there used the browser widget with SPAs and if so, what has your experience been? Any tips or suggestions appreciated.

Any ideas for how I can obtain the URL of browser as at the moment, I'm stumped...

~ Rodney

rodneyt
Posts: 128
Joined: Wed Oct 17, 2018 7:32 am

Re: browser widget, URLs and Single Page Apps (SPA)

Post by rodneyt » Wed Oct 17, 2018 8:48 am

A few follow up observations:
- navigating by following hyperlinks in page content updates widget URL
- navigating by SPA UX features (e.g. selecting a file from file listing in our app, or changing "tabs" which also changes document and browser URL) does not
- browser navigation commands (cmd + left / right arrow) continue to navigate content history correctly

Post Reply

Return to “Talking LiveCode”