Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do i run a script after WebViewer finished loading?

Featured Replies

  • Newbies

Hello,

i want to start a script after the webviewer has finished loading, because i have to read out some summarys from the Webviewer.

Is there any way to trigger a script after loading completed?

Thank you!

This is the script that I came up with in my solution:


##

# Load URL Script

#

Set Error Capture [ On ]

Set Variable [ $webviewer; Value:"webviewer" ]

Set Variable [ $url; Value:"http://www.fmforums.com/" ]

Set Variable [ $lastTag; Value:"</html>" ]

Set Variable [ $timeout; Value:30 ]

##

# Load the URL

#

Set Web Viewer [ Object Name: $webviewer; URL: $url ]

If [ Get(LastError) ]

# Error: Either the webviewer is missing or did not load properly

Exit Script [ Result: False ]

End If

##

# Wait for the URL to load

#

Loop

Pause/Resume Script [ Duration (seconds): 1 ]

If [ GetLayoutObjectAttribute ( $webviewer ; "content" ) <> "<HTML></HTML>" ]

Exit Loop If [ PatternCount ( GetLayoutObjectAttribute ( $webviewer ; "content" ) ; $lastTag ) ]

End If

Set Variable [ $timer; Value:$timer + 1 ]

If [ $timer = $timeout ]

# Error: Url did not load in time

Exit Script [ Result: False ]

End If

End Loop

Note: The "<>" symbol should be a "Not Equals" symbol.

I hope that helps!

Is there any way to trigger a script after loading completed?

No, but you can put a script in a looped pause and exit the loop when the page has loaded. Usually, you can tell a page has loaded when the web viewer's content contains the string "</html>", but it really depends on the specific page.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.