The Blog of Brad
Posts tagged safari
Bookmarklets I Frequently Use
Apr 16th
The iPhone Safari browser is amazingly limited — no “find in page” function, no extensions, and no other search providers available (either Google or Yahoo). However the iPhone’s been gifted an amazing rendering engine and Javascript library, which is why I recommend the following Javascript bookmarklets.
If you aren’t sure how a bookmark differs from a bookmarklet, take a look at Wikipedia, or read my simple explaination: a bookmarklet is a saved line of Javascript code which provides some functionality and has all of the capabilities of Javascript on the currently displayed page, including navigating to a new page and modifying the page itself. A bookmarklet is activated when you open the bookmark (click it). On the iPhone there’s only one native way to get bookmarklets onto the phone — by bookmarking them on Safari on your computer then syncing them to Safari on the iPhone (done through iPhone). There are some bookmarklet providers which provide helper install pages to get around this limitation.
The iPhone bookmarklet installer bookmarklet: Found at joemaller.com/___
When activated this bookmarklet will add text to the beginning of each link found on the page so that you can bookmark it (see the site for more information).
The 1Password bookmarklets:
If you have an iPhone and the 1Password you can use the “lookup in 1Password” bookmarklet which automatically open 1Password with the current page address and allows you to copy your password. Immediately after copying some text you’re returned to Safari where you can input it. 1Passsword can be synced in app over WiFi to the Mac OS X version of 1Password.
OR
If you don’t have the 1Password iPhone app and have the desktop version you can make a self-contained bookmarklet which does the same thing in browser. New passwords are synced to this by the 1Password app on OS X. (learn more about option # 2 at the 1Password site)
Delicious – (see this page for instructions)
This just navigates you to an iPhone friendly way to bookmark using Delicious, pretty simple, very useful.
Find in Page – (Javascript to bookmark)
This open a Javascript prompt where you enter a phrase (case-independent) to find in the page; matches are counted and highlighted in yellow and bold.
Open Links in new Window – (Javascript to bookmark)
When activated this changes all links on the current page to spawn a new tab to view them.
Dictionary – (Javascript to bookmark)
This open a prompt to enter a word and redirects you to a definition of the word.
Wikipedia – (Javascript to bookmark)
This opens a prompt where you enter a Wikipedia query.
Mobilize This! – (Javascript to bookmark)
This bookmarklet open the currently open (or loading) page to be opened using the Google mobilizer service (shows only plain text, much quicker to load).
Read It Later – log in to your Read It Later account to find these bookmarklets
This adds the current page (or current loading page) to your Read It Late queue.
Quick Tip: Stream Audio in Background on iPhone/iPod Touch on OS 3.0
Jun 24th
I’m a TWiT aficionado and always use the TWiT.am app from the App Store, however it doesn’t work in the background (a feature I LOVED when I had my iPod jailbroken) however, I got curios and tried this, and so can you!
- Go to http://twit.am/ in Safari
- Click on Listen Live
- [A Player opens – as seen below]
- Click the home/menu button on the front of the device and the audio keeps playing in the background.
Why I Don’t Use Firefox: Temptation
Mar 22nd
Unlike just about every other person on this earth who isn’t a n00b, I don’t use Firefox. I look at this as the result of five crucial reasons… More >
CODE: Webkit (without timer function)
Feb 24th
As noted in an earlier post I’ve been working on a script which will get the latest Webkit (nightly) build and automatically install it, delete the old file, mount/unmount the dmg, then delete the DMG…. Here is the code (I will release the timer function code soon):
on run
getwebkitURL()
set webkitURL to the result
downTHEwebKIT(webkitURL)
set desktopURL to "~/Downloads/webkit-new.dmg"
set webkitexistingfile to "/Volumes/Macintosh HD/Applications/Webkit.app"
do shell script "rm -f -r /Volumes/Macintosh HD/Applications/Webkit.app"
do shell script "hdiutil attach ~/Downloads/webkit-new.dmg"
--do shell script "ditto /Volumes/WebKit/Webkit.app /Volumes/MacintoshHD/Applications/"
tell application "Finder"
delete "MacintoshHD:Applications:Webkit.app"
move (contents of "WebKit:WebKit.app") to "MacintoshHD:Applications"
end tell
do shell script "hdiutil unmount /Volumes/Webkit"
tell application "Finder"
delete "MacintoshHD:Users:bradleyarsenault:Downloads:webkit-new.dmg"
end tell
end run
on downTHEwebKIT(webkitURL)
set webkitURL to webkitURL
set desktopURL to "~/Downloads/webkit-new.dmg"
set curlURL to ("curl -o " & desktopURL & " " & webkitURL)
do shell script curlURL
end downTHEwebKIT
on getwebkitURL()
set curlURL to "curl http://nightly.webkit.org/"
do shell script curlURL
set webkitPage to the result
set osxOffset to the offset of "<p><strong><a href=" in (webkitPage as string)
set webkitshortPage to (characters (osxOffset + 20) thru (count webkitPage) in webkitPage as string)
set dmgOffset to the offset of ".dmg" in (webkitshortPage as string)
set webkitURL to characters (1) thru (dmgOffset + 3) of webkitshortPage as string
return webkitURL
end getwebkitURL
Google Chrome-What Browser Am I Using?
Sep 2nd
A common trick web developers use is to determine which browser you are using to assure that an incompatible browser doesn’t have a bad experience on a site, or to change the formatting to suit the browser (really common for Internet Explorer 6)… anyway I’m using the recently released Google Chrome (to download it: google “Google Chrome Download”, or go to www.google.com/chrome) and I tested Chrome against one of these scripts (the site I used is located here) and found that the script showed Chrome as Safari 525.13 on Windows. More >

