andy-portmen / external-application-button

Communicate with external applications of your OS through a toolbar button or context menu item.
https://webextension.org/listing/external-application-button.html
174 stars 56 forks source link

External Application can't grab video URL if Link Context+Video Context both enabled #89

Open GunGunGun opened 1 year ago

GunGunGun commented 1 year ago

Test page: https://www.w3schools.com/html/html5_video.asp

How to:

Expected result:

My browser:

Button code:


    "active": "0.196969416196353",
    "apps": {
        "0.196969416196353": {
            "icon": "/data/icons/app.png",
            "errors": true,
            "quotes": true,
            "closeme": false,
            "changestate": "",
            "name": "MPV",
            "path": "D:\\mpv\\mpv.exe",
            "args": "--ytdl [HREF]",
            "pre": "document.currentScript.output = location.href;",
            "post": "",
            "toolbar": true,
            "context": [
                "link",
                "video"
            ],
            "pattern": "",
            "filters": "",
            "redirects": ""
        },
andy-portmen commented 5 months ago

You can either use pre-script to get the video URL with document.activeElement.src or create two context menu items. One for the video and one for the link.