Skip to content

v1.4.0

Choose a tag to compare

@ioa747 ioa747 released this 01 Jan 14:40
· 547 commits to main since this release
eed8c8e

Added

  • Unified Settings & Permissions (New Property System)

    • Implemented a comprehensive set of Read/Write properties to control WebView2 behavior directly from AutoIt.
    • Properties (DispIds 170-179, 183):
      • AreDevToolsEnabled (170): Toggle Developer Tools.
      • AreDefaultContextMenusEnabled (171): Control native context menus.
      • AreDefaultScriptDialogsEnabled (172): Suppress or allow alerts/prompts.
      • AreBrowserAcceleratorKeysEnabled (173): Manage browser shortcuts.
      • IsStatusBarEnabled (174): Toggle the status bar.
      • ZoomFactor (175): Direct access to zoom level.
      • BackColor (176): Set background color using Hex strings (e.g., "0xFFFFFF").
      • AreHostObjectsAllowed (177): Control JS bridge access.
      • Anchor (178): Manage control resizing behavior.
      • BorderStyle (179): Placeholder for border style configuration.
      • AreBrowserPopupsAllowed (183): Control new window/popup allowance.
    • Methods (DispIds 180-182, 184):
      • SetZoomFactor (180): Helper method for zoom.

      • OpenDevToolsWindow (181): Programmatically open DevTools.

      • WebViewSetFocus (182): Force focus to the WebView control.

      • **

        AddInitializationScript** (184): Injects and manages persistent JS logic.

  • Custom Context Menu System

    • Implemented OnContextMenu COM event (DispId 6) to intercept user right-clicks.
    • Added data payload support providing context metadata (Coordinates, Kind, TagName, Selection, Source URL, Link URL) via JSON.
    • Sent as raw JSON string (prefixed with "JSON:") to avoid Base64 overhead.
  • Focus Management Overhaul

    • OnBrowserGotFocus (DispId 11): Native event triggering when WebView gains focus.
    • OnBrowserLostFocus (DispId 12): Native event triggering when focus leaves the WebView hierarchy.
    • Refactored logic to use AreDevToolsEnabled style properties instead of legacy timers for cleaner integration.
  • Utilities

    • EncodeURI (DispId 165): Native UTF-8 encoding for safe URL parameter generation.
    • DecodeURI (DispId 166): Native decoding to convert percent-encoded strings.
    • EncodeB64 (DispId 167): Native encoding (UTF-8) -> Base64.
    • DecodeB64 (DispId 168): Native decoding Base64 -> String (UTF8).
  • Navigation Lifecycle Events

    • OnNavigationStarting (DispId 2): Intercepts and validates URLs before loading.
    • OnNavigationCompleted (DispId 3): Detailed navigation status and WebErrorStatus.
  • State Synchronization

    • OnTitleChanged (DispId 4): Real-time synchronization of document title.
    • OnURLChanged (DispId 13): Real-time tracking of URL changes.
    • OnZoomChanged (DispId 10): Event fired when zoom level changes.
  • Property Getters

    • GetSource (DispId 135) & 

      GetDocumentTitle (DispId 134).

    • GetCanGoBack (DispId 162) & 

      GetCanGoForward (DispId 163).

    • GetBrowserProcessId (DispId 164).

  • Permanent JavaScript Injection System

    • Implemented 

      AddInitializationScript (DispId 184): Allows permanent injection of JavaScript libraries (like bridge.js) that persist across navigations and page refreshes.

    • Added automated script lifecycle management using AddScriptToExecuteOnDocumentCreatedAsync.

    • Integrated Script ID Tracking: The library now remembers the last injected script ID to allow clean replacement or removal, preventing memory leaks and script duplication.


Fixed

  • Focus Bounce Issue Resolved where internal focus changes triggered false "LostFocus" events. Implemented robust checks using BeginInvoke and GetFocus with IsChild verification.
  • CS1061 Compile Error Corrected TitleChanged to standard DocumentTitleChanged event mapping.
  • Context Menu JSON Fixed JSON escaping for special characters in selection text and URLs.

Changed

  • Refactored Event Registration Cleaned up 

    RegisterEvents to remove legacy AdBlock/Context Menu duplication while preserving functionality.

  • DispId Standardization Re-mapped OnURLChanged to DispId 13 to avoid conflicts.

  • Extension Management

    • AddExtension (DispId 150) now triggers a notification event with the internal ID for better lifecycle management via 

      RemoveExtension (DispId 151).