Jump to content

Recommended Posts

Posted (edited)

Link2AutoIt - Firefox Add-on

Introduction

Link2AutoIt is a high-performance IPC bridge designed to connect Mozilla Firefox with AutoIt. It allows your scripts to react to browser events—like hovering over or clicking on links and images—in real-time, with near-zero latency.


512.webpCurrently optimized and signed for Mozilla Firefox.
However, since it uses the standard Native Messaging API, support for Chrome and Edge is planned for future updates requiring only minor manifest and registry adjustments).


The Problem & The Solution

Standard Native Messaging closes the host process as soon as the message is sent. To bypass this and keep the AutoIt listener lightweight, Link2AutoIt uses a unique architecture:

  • Shared Memory (IPC): A persistent memory buffer (8KB) acts as a lightning-fast relay.

  • Non-Blocking Architecture: Your AutoIt script doesn't have to wait or poll; it receives signals via Windows Messages (GUIRegisterMsg).


How it Works

  1. Firefox Extension: Monitors the DOM for mouse events and dispatches JSON payloads.

  2. LinkHost.exe: A tiny relay that catches the browser's message and writes it to Shared Memory.

  3. Proxy.exe: The "Anchor" process that ensures the shared memory segment stays alive.

  4. Your Script: Uses the provided UDF to read metadata instantly.
     

New in Version 3.0

  • Rich Metadata: Captures URL, Domain, Action Type, MediaType (Link vs Image), and Text/Alt attributes.

  • Built-in Blacklist: A smart, encapsulated domain filtering system to ignore ads/trackers.

  • Local Static Logic: Improved UDF functions to handle data persistence and debouncing without global variable clutter.
     

Officially Signed & Approved by Mozilla: Version 3.0 has passed the screening process and is digitally signed by Mozilla. This ensures a seamless and secure installation without "unverified extension" warnings.
 

Example_GetLastLink.au3

; Example_GetLastLink.au3
#include "Link2AutoIt.au3" ; Include your new library

_L2A_Init() ; initialization to ensure Proxy is running

HotKeySet("{F8}", "_GetLastLink") ; Set Hotkey to trigger the function

; Main Loop
While 1
    Sleep(100)
WEnd

; Function triggered by F8
Func _GetLastLink()
    ; Use the UDF function to get specific fields
    Local $sUrl = _L2A_GetURL()
    Local $sDomain = _L2A_GetDomain()
    Local $sAction = _L2A_GetActionType()

    ; Check if we have data
    If $sUrl <> "" Then
        Local $sDisplayUrl = $sUrl
        If StringLen($sDisplayUrl) > 80 Then $sDisplayUrl = StringLeft($sDisplayUrl, 77) & "..."
        _L2A_ToolTip($sDisplayUrl, Default, Default, "URL:")
        ConsoleWrite("--- Link Caught ---" & @CRLF)
        ConsoleWrite("Action: " & $sAction & @CRLF)
        ConsoleWrite("Domain: " & $sDomain & @CRLF)
        ConsoleWrite("URL:    " & $sUrl & @CRLF)
        ConsoleWrite("-------------------" & @CRLF)
    Else
        ConsoleWrite("! No link found in shared memory. Make sure Proxy.exe is running." & @CRLF)
    EndIf
EndFunc

 

Please, every comment is appreciated!
leave your comments and experiences here!
Thank you very much  :)

 

https://github.com/ioa747/Link2AutoIt

 

* For information, this presentation was made in .md format in obsidian and was copied as .html

Edited by ioa747

I know that I know nothing

  • ioa747 changed the title to Link2AutoIt - Firefox Add-on

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...