What about "browser helpers"?

Mac OSX specific forum
User avatar
Piero
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

What about "browser helpers"?

Post by Piero »

Is this possible in PB?

I save an applescript app like this:

Code: Select all

on open location this_URL
	display dialog this_URL
end open location
Side note: you can modify/open applescript(able) apps in script debugger/script editor; you will see the code or the scriptable app dictionary...

Then I add this to its info.plist dict:

Code: Select all

	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLName</key>
			<string>wtfloader</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>wtfps</string>
			</array>
		</dict>
	</array>
Then I add to (Firefox?) a bookmark like this:

Code: Select all

javascript:(function(){ window.open('wtfps://???'+window.location); })();
 
…I can now process the page/link I am seeing in (Firefox?) by clicking/choosing the bookmark...
User avatar
Piero
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: What about "browser helpers"?

Post by Piero »

I realize I wasn't very exhaustive about the possibilities
1st: that "???" was arbitrarily added by me, and you can use "javascript bookmarks" e.g. to redirect to other sites (even replacing parts/verifying "link string" before) like this:
javascript:(function(){ window.open('https://9xbud.com/'+window.location); })();
That's a youtube downloader (I generally use yt-dlp instead)

Also, after you made a "modified" (applescript) app as shown above, you can use it to process all links, by using "open with..." browser extensions
User avatar
Piero
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: What about "browser helpers"?

Post by Piero »

Temporary solution:

1) Make a PB app like this

Code: Select all

MessageRequester("da_link",ProgramParameter())
 
 
2) Save this Applescript as app

property appn : "/path/to/YOUR_PB_APP.app/Contents/MacOS/YOUR_PB_APP"

on open location the_link
    do shell script quoted form of appn & " " & quoted form of the_link & " > /dev/null 2>&1 &"
end open location

3) Modify its plist as explained on post above...
User avatar
Piero
Enthusiast
Enthusiast
Posts: 281
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: What about "browser helpers"?

Post by Piero »

Post Reply