WebExeBuilder Documentation

canGoForward

Category: Browser Control

Namespace: web.browser.canGoForward

Description

Check if the browser can navigate forward in history. Returns true if there are next pages.

Syntax

await web.browser.canGoForward();

Parameters

None

Returns

Promise<boolean> - Returns true when operation completes

Example

Simple example

const canGoForward = await web.browser.canGoForward();
console.log('Can go forward:', canGoForward);

Practical example

const canGoForward = await web.browser.canGoForward();
document.getElementById('forward-btn').disabled = !canGoForward;

Advanced example

async function checkNavigationState() {
    const canGoBack = await web.browser.canGoBack();
    const canGoForward = await web.browser.canGoForward();
    const url = await web.browser.getCurrentUrl();
    
    console.log('Navigation state:', {
        url: url,
        canGoBack: canGoBack,
        canGoForward: canGoForward
    });
    
    return { canGoBack, canGoForward, url };
}

Use Cases

  • Enable/disable forward button
  • Check navigation history
  • Update UI button states
  • Validate navigation actions
  • Show/hide navigation controls
  • Implement smart navigation
  • Track history availability
  • Conditional navigation logic
  • web.browser.forward()
  • web.browser.canGoBack()

Notes

  • Part of browser control functionality
  • Asynchronous operation
  • Returns promise