Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Drag and drop files to Safari's Choose File button Web Browsers
It's possible to drag and drop files to the Choose File button you'll see on some web sites -- like the one you'll see if you click the "Attach a File" button in Gmail. You do not have to click the Choose File button and then navigate the Open dialog; just drag and drop directly from the Finder to that button. This is quite handy when working with Gmail and attachments.

[robg adds: This was originally published in this post on the author's blog, where a screenshot provides some additional clarification, if you need it.]
  Post a comment  •  Comments (3)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[10,580 views] Email Article To a Friend View Printable Version
Automatically update WebKit via script and launchd Web Browsers
WebKit doesn't have any way to automatically update to the latest nightly build, so I put together a quick script to do so.

It has the option of automatically backing up the currently installed version of WebKit, or just removing the old version and updating to the newer version. There's also optional logging of the old WebKit build, the new WebKit build, and what time it was replaced. By creating a launchd agent, it can be run automatically every night. The script is:
#!/bin/sh
#Automatically update to the latest WebKit nightly build.
#By Zach Drayer, zach@drayer.name
#-----------------------------------------------------------------------------
#Set environment up
#-----------------------------------------------------------------------------
export LOGGING_LOCATION="$HOME"/Library/Logs/WebKitUpdate.log
export WEBKIT_BACKUP_LOCATION=""$HOME"/Documents/WebKit Backup/"
curl -LOs "http://nightly.webkit.org/index.html" 
export WEBKIT_NIGHTLY_BUILT_VERSION=`cat index.html | grep mac/WebKit-SVN | grep Download | cut -c 47-51`
if [ -d /Applications/WebKit.app ]; then
  export WEBKIT_INSTALLED_VERSION=`cat /Applications/WebKit.app/Contents/Resources/VERSION`
  if [ "$WEBKIT_NIGHTLY_BUILT_VERSION" == "$WEBKIT_INSTALLED_VERSION" ]; then
    exit
  fi
fi
export WEBKIT_TEMP_INSTALL_LOCATION="/tmp/WebKit-$WEBKIT_NIGHTLY_BUILT_VERSION-$RANDOM"
mkdir "$WEBKIT_TEMP_INSTALL_LOCATION"
cd "$WEBKIT_TEMP_INSTALL_LOCATION"
#-----------------------------------------------------------------------------
#Checks if WebKit is running or not
#-----------------------------------------------------------------------------
ps aux | grep Web >> web.txt
cat web.txt | grep WebKit >> web2.txt
WEBKIT_RUNNING=`cat web2.txt`
if [ "$WEBKIT_RUNNING" != "" ]; then
  kill -9 `cat web2.txt | sed s/"$USER"      //g | cut -c 1-5`
fi
#-----------------------------------------------------------------------------
#Back WebKit up
#-----------------------------------------------------------------------------
if [ -d /Applications/Webkit.app ]; then
  #Comment out this if/elseif block if you don't want to back WebKit up
  #Start commenting below --v
	if [ -d "$WEBKIT_BACKUP_LOCATION" ]; then
		mv /Applications/WebKit.app "$WEBKIT_BACKUP_LOCATION"WebKit-r"$WEBKIT_INSTALLED_VERSION".app
	else
		mkdir "$WEBKIT_BACKUP_LOCATION"
		mv /Applications/WebKit.app "$WEBKIT_BACKUP_LOCATION"WebKit-r"$WEBKIT_INSTALLED_VERSION".app
	fi
	curl -LOs "http://nightly.webkit.org/files/trunk/mac/WebKit-SVN-r"$WEBKIT_NIGHTLY_BUILT_VERSION".dmg"
else
  #Stop Commmenting here --^
#Also uncomment the next line if you dont back WebKit up
#	rm -rf /Applications/WebKit.app
	curl -LOs "http://nightly.webkit.org/files/trunk/mac/WebKit-SVN-r"$WEBKIT_NIGHTLY_BUILT_VERSION".dmg"
fi
#-----------------------------------------------------------------------------
#Install WebKit
#-----------------------------------------------------------------------------
hdiutil attach -quiet "$WEBKIT_TEMP_INSTALL_LOCATION"/WebKit-SVN-r"$WEBKIT_NIGHTLY_BUILT_VERSION".dmg
cp -R /Volumes/WebKit/WebKit.app /Applications/
hdiutil detach -quiet /Volumes/WebKit
rm -rf "$WEBKIT_TEMP_INSTALL_LOCATION"
#-----------------------------------------------------------------------------
#Logging
##Comment this block out if you dont want a log of 
#-----------------------------------------------------------------------------
echo "WebKit build " $WEBKIT_NIGHTLY_BUILT_VERSION " replaced build " $WEBKIT_INSTALLED_VERSION " on " `date` 
>> $HOME/Library/Logs/WebKitUpdate.log
A sample plist for a launchd agent looks like this: Alternately, you can download the script here, and the plist here.

[robg adds: This script worked as described, though I didn't test the launchd agent. Depending on your connection speed, it may take a few minutes to run, so give it time.]
  Post a comment  •  Comments (9)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[14,290 views] Email Article To a Friend View Printable Version
Use a free plug-in to add 'close on middle click' to Safari Web Browsers
Firefox has a neat feature for people with multi-button mice: clicking a tab with the middle button will close that tab. Safari doesn't have this feature, but using SIMBL and this free plug-in I wrote, you can have it. I've tested this on Safari 3.1 on Leopard, and Safari 3.0 on Tiger, and it works in both OSes and Safari versions.

It's released under the GPL, so you can download and view the source if you wish.
  Post a comment  •  Comments (8)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[9,328 views] Email Article To a Friend View Printable Version
Open Firefox Google searches in new tabs/windows Web Browsers
I always run web searches directly from the toolbar field in my web browsers. In Safari, as explained in this hint, you can search directly in a new window (or tab, depending on your settings) by pressing Command-Enter in the search field.

In Firefox, however, this won't work. Instead, use Option-Return (which also works in the URL bar itself), and you'll get your search results in a new tab or window.
  Post a comment  •  Comments (4)  
  • Currently 1.17 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[16,113 views] Email Article To a Friend View Printable Version
Load Gmail even if it seems to be locking up Web Browsers
A few times recently I've been unable to access my Gmail account using Safari or Firefox. I click on my bookmark link to gmail.com and the page freezes, seemingly while loading data from google-analytics.com, according to the status bar. I'm not sure if this is because I've got ad blocking software installed, but the problem eventually goes away after a few hours.

I figured that login system failure is the issue, rather than the service itself, so I went to google.com and logged in there using the Sign-in link at the top right of the page. Then I clicked the Mail link at the top left. Hey presto -- I could access my Gmail, although it was still slow and cranky (IM contacts wouldn't load, for example). But at least I could access my messages.

I'm not sure if this is just a Mac issue or whether it affects all platforms -- a quick search reveals that it does indeed seem to be surprisingly prevalent. But I thought I'd submit it anyway.
  Post a comment  •  Comments (6)  
  • Currently 1.60 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[5,577 views] Email Article To a Friend View Printable Version
Import Sogudi's Safari shortcuts to Firefox Web Browsers
If you are a Safari user and use Sogudi, you'll know how easy it is to use its shortcuts. When I moved to Linux, I needed a way to import my shortcuts to Mozilla Firefox, which has the same feature (known as Quick Searches). So, I wrote sogudi2qs.py, a Python script that exports all shortcuts into a file that can then be imported into Firefox's bookmarks.

To use it, download the script [view source], then type this in Terminal:
$ cd /path/to/download/location
$ unzip sogudi2qs.py_.zip
$ python sogudi2qs.py >quicksearches.html
That will create a file named quicksearches.html in the current directory. Then just import that file into Firefox's Bookmarks, and you've transferred all your Sogudi shortcuts.

[robg adds: There's a Sogudi Beta available for 10.5 users; I haven't tested it, however.]
  Post a comment  •  Comments (1)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[6,087 views] Email Article To a Friend View Printable Version
Force 'new window' links to open in new tabs in Safari Web Browsers
After browsing for a few hours in Safari, it's possible to end up with a dozen windows or so because of links that open a new window (links with target="_blank"). I've always wished there was a way to have these links open in a new tab instead of a new window (sometimes referred to as single window mode).

In the latest Safari 3.1, Apple finally added a (hidden) preference to do just this! To enable single window mode, which forces all links that would normally open a new window appear in a new tab instead, we only need to enable the TargetedClicksCreateTabs preference using the following command (paste it into Terminal):
defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
[robg adds: This worked for me, but note that it will create those new tabs in the foreground, not the background. Command-clicking the link, however, will open the page in a new tab in the background (this has always been true, as I recall). The preference setting is mostly useful for sites you haven't visited before -- with it set, you'll not have window proliferation if you just click instead of command-clicking. To undo the setting, you can just delete the preference: defaults delete com.apple.Safari TargetedClicksCreateTabs. Make sure Safari's not running before you use either command.]
  Post a comment  •  Comments (29)  
  • Currently 2.82 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (11 votes cast)
 
[86,039 views] Email Article To a Friend View Printable Version
10.5: Automatically Quick Look certain downloaded files Web Browsers
I have wanted to Quick Look files directly from the browser for a while (especially .doc and .ppt files). A switch to Firefox recently exacerbated this problem, as there is no PDF plug-in. So I wrote a simple script that monitors the Downloads directory and opens any new files with qlmanage, and thought others might find it useful. Copy and paste the code below into a file (say ql_downloaded.sh) and make it executable (chmod a+x ql_downloaded.sh). Launch the script in a separate Terminal window, then start browsing. This bit -- if [[ $i == *.(pdf|ppt|xls|doc) ]]; then -- restricts which files are Quick Looked. In Firefox, the handling option for these types of files should be set to Save to Disk. The above code should work with most any browser; it works most of the time for me, but there are still some random issues once in a while (probably due to the temporary ".part" files created during downloads). Hope you find this useful!

[robg adds: This worked for me in testing with Firefox and Safari.]
  Post a comment  •  Comments (6)  
  • Currently 1.17 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[19,213 views] Email Article To a Friend View Printable Version
Create new tabs via double-click in Safari 3.1 Web Browsers
As of Safari 3.1, double-clicking on a free area in the tab bar opens a new tab. I've wanted this feature since it was introduced in Firefox, and now my favorite browser has it, too.
  Post a comment  •  Comments (5)  
  • Currently 1.17 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[8,748 views] Email Article To a Friend View Printable Version
View higher quality videos on YouTube Web Browsers
Many people are using a trick to view any YouTube video in high-quality -- simply append &fmt=18 to the end of the URL. This is a job for AppleScript! Here are two simple versions; the first, for for OmniWeb:
tell application "OmniWeb"
  set current_url to the address of active tab of browser 1
  set current_url to current_url & "&fmt=18"
  set the address of active tab of browser 1 to current_url
end tell
...and the second, for Safari:
tell application "Safari"
  set current_url to the URL of current tab of window 1
  set current_url to current_url & "&fmt=18"
  set URL of current tab of window 1 to current_url
end tell
These can be placed in ~/Library » Scripts » Applications » AppName for easy access via the Script menu.

[robg adds: Queue user fds suggests that a JavaScript bookmarklet may work better, and it will work in any browser. Create a new bookmark for any site (or a blank bookmark), then change its URL to this: javascript:window.location+="&fmt=18";. Choose that bookmark while viewing a YouTube video, and you should get the high quality version.]
  Post a comment  •  Comments (11)  
  • Currently 2.17 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[25,720 views] Email Article To a Friend View Printable Version