If you're a Google Chrome user, you may like its Omnibar because it allows you to instantly search the web and leverage your URL history at the same time. This hint explains how to instantly get to an Omnibar from within any application.
You need two things for this hint: An AppleScript and a hotkey manager. For the hotkey manager I use Quicksilver but anything that allows you to run AppleScripts or applications on a keystroke is fine.
For the script, open AppleScript Editor and save the following code as a script (or an application if you're going to run it as an application), for example calling it Open Omnibar.
tell application "Google Chrome"
if (count of windows) is 0 or front window is not visible then
make new window
else
make new tab at end of tabs of front window
end if
activate
end tell
What this code does is first it checks if any Chrome windows are visible, if not it opens a new window. If a window is visible you get a new tab. Chrome automatically places the cursor in the Omnibar.
So if you assign this script to a hotkey, you can simply hit the hotkey and when you see the Omnibar, start typing.
[crarko adds: I haven't tested this one. If you're running Snow Leopard you could probably set this up as an Automator Service that runs the script.]
In Safari, we all know if you highlight some text and then Control+click (or right mouse click) you get a pop up contextual menu. I use this to search text in Google all the time, but didn't like that it would open in front while I was still reading the web page. So with a little experimenting, if you hold down the Command key before you click on 'Search with Google' in the pop up menu, the page will open in a tab behind your current one.
[crarko adds: I tested this, and it works as described.]
To date, people who wanted to view downloaded PDFs on a Mac have had three options:
Use Safari's in-line PDF viewer plug-in to view PDFs in Safari.
Use Firefox v3 and the Firefox PDF plug-in for Mac to view PDFs in Firefox.
Use a current version of Firefox, download the PDFs, and view them in a PDF reader app.
That's right -- there was no way to view PDFs in Firefox 4 or 5 as one could do in Safari, because the Firefox PDF plug-in didn't work above Firefox 3.6.
That is, it didn't officially work. But it turns out that with some simple modifications, you can get this plug-in to work just fine in Firefox 5 and probably future versions of Firefox, thus allowing you to view PDFs in the browser once again.
With the Applications folder open in Finder, do a Get Info on Firefox.
Check the box for 'Open in 32-bit mode.'
If Firefox is currently open, quit and relaunch it.
Download the Firefox PDF Plug-in for Mac (this is the beta 1.2 plug-in; the official 1.1.3 plug-in doesn't work with this procedure).
When prompted, Save the downloaded file.
You should get a file called fx-quartz-pdf-1.2.0.xpi in your Downloads folder. Double-click it to decompress it.
Inside the resulting folder, you'll see 'install.rdf.' Open this file in TextEdit or vi or another simple text editor.
Look for a line reading '<em:maxVersion>4.0.*</em:maxVersion>'.
Change that 4 to 20. (Or you could change it to 5, but since Firefox is going to go through version numbers pretty quickly, you should pick one pretty far out.)
Save and exit.
Select all the files in the fx-quartz-pdf-1.2.0 folder, right-click on them, and select 'Compress 6 items.' Do NOT compress the containing folder or it won't work later on.
Now you'll have a file called Archive.zip. Rename this file fx-quartz-pdf-1.2.0.xpi.
In Firefox, go to the Tools menu and select Add-Ons.
At the top of the window, look for the button with the gear icon. Click this and select 'Install Add-On from File.'
Browse to and select the fx-quartz-pdf-1.2.0.xpi file you created.
Approve the add-on installation when prompted.
Now this may work fine for some of you and you may be done. Test the add-on by attempting to open an online PDF. If it opens in the browser, great, you're done. But in my case, more work was required, because Firefox claimed that the add-on was installed, but it wasn't actually working. So I had to do some additional clean-up.
Quit Firefox.
Open ~/Library/Application Support/Firefox/Profiles/[random_characters].default/extensions/.
You should see a file called colesbury@gmail.com.xpi. It's the compressed file we created earlier, but with a different name. I think this is why it's not working. If you see a folder called colesbury@gmail.com instead, you have some other problem.
Go up one level to the [gibberish].default folder. You should see a file called extensions.ini. Open this file in your text editor.
Look for an entry that ends with colesbury@gmail.com.xpi.
Remove the '.xpi' extension.
Save and exit.
Back in the extensions folder, double-click on colesbury@gmail.com.xpi. This should expand it into a folder named colesbury@gmail.com. If necessary, delete the previous .xpi file.
Launch Firefox 5. It should properly display PDFs in the browser now.
The Private Browsing mode in Safari has no default keyboard shortcut, and the toggle has a modal confirmation dialog. This hint shows how to assign a keyboard shortcut to Private Browsing and bypass the confirmation dialog.
One of my favourite features of Mac OS X is the ability to assign a keyboard shortcut to any menu item of any application. This is fairly straightforward and was covered in many hints before.
In order to assign a keyboard shortcut, in this case to the Private Browsing toggle in Safari, we have to do the following:
Open System Preferences and navigate to 'Keyboard' section.
Select the 'Keyboard Shortcuts' tab.
Select 'Application Shortcuts' from the list.
Click on the Plus sign, select the application, type in the name of the menu item, and enter the shortcut.
The instruction says that we should 'Enter the exact name of the menu command you want to add.' When doing so, i.e. type 'Private Browsing…' the keyboard shortcut will execute the default action and presents the confirmation dialog window.
In order to bypass that dialog, we have to type 'Private Browsing' (without the elipsis) as the menu item name. As a result, the keyboard shortcut will instantly toggle private browsing on and off.
You will notice that there are now two menu items in Safari menu called Private Browsing, one with the shortcut assigned, and the default one with the elipsis.
The shortcut I use is Command+Shift+P. It is easy to remember, does not interfere with printing (Command+P), and makes private browsing a feature I actually use on a regular basis (e.g. when accessing my bank account).
[crarko adds: I tested this, and it works as described.]
I often receive PDF files which show up as either blank or with blank lines in Preview. Earlier I used to open them in Adobe Acrobat Reader to see the content; however now I've found a better way.
You can open them in Google Chrome -- Chrome uses its in-built PDF reader which shows the content of the PDF file correctly.
I'm not sure why this happens, however it has happened with many PDF files - especially ones which have filled-in forms.
[crarko adds: I don't recall encountering this problem myself, but here is another tool to try if you do.]
There are a few websites that look ugly in any browser (Lifehacker, Gizmodo, etc). But, they look better on iOS devices.
Safari 5 has the ability to pose as another browser. That way you can get the iOS view on Safari on your Mac.
First, open Safari and go to the Preferences, move to Advanced. At the bottom of the tab there is a check box for 'Show Develop menu in menu bar.'
Once that s activated you'll see the menu. Go there and move to User Agent and select any iOS device. Now you can browse to whichever website you know looks better on iOS format.
[crarko adds: We've talked about the Develop menu before, but it's an interesting tidbit to find site that look better in iOS. I'm guessing it's the lack of Flash.]
When you Command-click a link in Safari, the browser opens the link in a new tab at the end of the tab bar. (This is assuming you have Command-clicks set to open in tabs instead of windows.) If you would rather the new tab were placed next to the current tab, a free extension I wrote called LinkThing will be of use to you.
You can set up the extension to open new tabs from links either to the right or to the left of the current tab. The placement can be specified differently for foreground vs. background tabs.
LinkThing can also make it so links open in new tabs by default (that is, when you just plain click them). This can be configured globally and/or for specific sites, and the setting can be applied to offsite links and onsite ones independently.
Here's a simple AppleScript that replaces the current Safari window with a collection of tabs, each open to a different URL. I've seen several scripts that attempt to do something similar, but this one improves on them in a couple of ways:
It closes all of the old tabs, rather than just adding new ones.
It opens the new tabs directly in AppleScript, which is much faster than using system events.
The URLs in the script are just an example; obviously you'll want to replace them with others.
tell application "Safari"
activate
-- close all but one tab of the front window
try
repeat
close tab 2 of window 1
end repeat
end try
-- open the URLs in separate tabs
tell window 1
set URL of tab 1 to "http://weather.yahoo.com/forecast/USMD0100.html"
make new tab with properties {URL:"http://www.weather.com/weather/today/College+Park+MD+20740"}
make new tab with properties {URL:"http://www.wunderground.com/cgi-bin/findweather/getForecast?query=20742"}
make new tab with properties {URL:"http://www.accuweather.com/us/md/college-park/20742/city-weather-forecast.asp"}
make new tab with properties {URL:"http://weather.weatherbug.com/MD/College%20Park-weather.html?zcode=z6286&zip=20742"}
end tell
end tell
[crarko adds: I tested this, and it works as described.]
If you're ever in the situation where you have forgotten the password for some web site, but it is right there in the password field of the login form -- only in the form of asterisks or bullets -- and you would like to copy it from the password field, if only it were not asterisks...well, you can.
You can convert the password field to a plain text field, which will reveal the password behind the asterisks. To do so, you will need to use your browser's web inspector. The following is the procedure for Safari; the steps are similar in Google Chrome.
Right-click the password field and select 'Inspect Element' in the context menu. This will open the web inspector and highlight the HTML tag for the password field.
The highlighted line should contain something like this:
<input type="password" name="something">
(Don't worry if it doesn't look exactly like that. As long as the HTML tag contains the type="password" part, you can proceed.)
Double-click the word "password" following "type=". This will let you edit the text.
Replace the word "password" with the word "text", and press Enter. Now the tag should like this:
<input type="text" name="something">
You should now be able to see the password in the password field. You can close the web inspector if you wish.
If this seems like a lot of work, an altenative is to install and use a browser extension that will reveal passwords when you do something like move the mouse over them or click inside them. For Safari, one such extension is ShowPass; similar extensions exist for Firefox and Google Chrome.
[crarko adds: I tested this, and it works as described. I used Safari 5.0.4.]