Page 1 of 1

What about "browser helpers"?

Posted: Wed Aug 09, 2023 1:17 pm
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...

Re: What about "browser helpers"?

Posted: Fri Aug 11, 2023 12:11 pm
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

Re: What about "browser helpers"?

Posted: Thu Aug 17, 2023 5:10 am
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...

Re: What about "browser helpers"?

Posted: Wed Jan 17, 2024 2:57 am
by Piero