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

Drag text to Safari's dock icon for quick Google search Web Browsers
This was touched on in a comment from a prior hint, but I think it's worth a standalone hint: You can drag any text to Safari's dock icon to perform a Google search of that text.

This is useful for quickly checking up on things without going to the keyboard. I discovered this when, on a whim, I dragged a line from Console onto Safari, and it brought up a search of that Console error.
  Post a comment  •  Comments (8)  
  • Currently 2.18 / 5
  You rated: 1 / 5 (11 votes cast)
 
[10,354 views]  View Printable Version
View PDFs inline in Firefox 3 Web Browsers
This hint is really just a link, but there have been several other hints dealing with PDF plug-ins for Mac browsers -- the Adobe plug-in only supports Safari) -- and this represents the first real solution for Firefox 3 I have seen.

There is now a Firefox extension named firefox-mac-pdf, available for Firefox 3 under OS 10.5 that utilizes the built-in PDF support in OS X to display PDFs in-browser. In my testing, it appears to work very well. It doesn't have the nifty fading bezel that the Safari PDF viewer does, but it supports all the same keyboard shortcuts and you get the standard Mac OS PDF contextual menu when you control-click on a displayed PDF.

[robg adds: This plug-in takes care of the only major complaint I had about Firefox; being able to view a PDF inline instead of opening it in Preview after downloading is a nice timesaver. I tested the plug-in this morning with about a dozen PDFs, and it worked great on all of them. The hint was submitted noting "Intel only," but the plug-in seems to work fine on my 12" PowerBook G4, too.]

[Updated 6/19: Removed 10.5-only restriction on hint.]
  Post a comment  •  Comments (26)  
  • Currently 2.80 / 5
  You rated: 1 / 5 (10 votes cast)
 
[27,489 views]  View Printable Version
Implement full page zoom in the WebKit browser Web Browsers
One of Firefox's niftier features is its full page zoom -- when you increase or decrease the size of page, everything on the page (text, images, etc.) zooms or shrinks at the same time. This helps keep the layout of the page closer to the original design when zooming; the end result (to me, anyway) looks nicer than when zooming just the text. The shipping version of Safari, on the other hand, only zooms or shrinks text, not images and other elements.

If you're running the WebKit version of Safari, however, you can activate full-page zooming using a simple Terminal command. Thanks to pamon for emailing me a pointer to this page on the Surfin' Safari blog that reveals the Terminal command. Quit Safari and WebKit, then enter this command in Terminal:
defaults write com.apple.Safari WebKitDebugFullPageZoomPreferenceKey 1
Launch WebKit, load a page, then experiment with Command-Minus and Command-Plus (technically, Command-Equals). You should see that all objects on the page are being resized, not just text. Note that Safari, because it uses an older version of the WebKit engine, won't be able to do full page zooming, even after running the above Terminal command. To reverse the settings, reverting WebKit to the "text only" zoom mode, repeat the above command, but change 1 to 0.
  Post a comment  •  Comments (10)  
  • Currently 2.75 / 5
  You rated: 2 / 5 (8 votes cast)
 
[13,721 views]  View Printable Version
Easily disable styles and JavaScript in Safari Web Browsers
If you're a web developer on the Mac, you may be sick of everyone talking about Firefox add-ons that do seemingly everything. True, Firefox is a great browser that is very expandable, but I love Safari, and I want to do as much web development on Safari as possible. The Firefox add-on feature that I missed the most in Safari was Disable Styles and Disable Javascript, both of which are super-easily done in Firefox via the Web Developer Plug-in. With the advent of Safari 3, disabling CSS and Javascript can be done with a couple of (user definable) keystroke combinations.

To gain control over JavaScript and CSS in Safari, open its preferences, and switch to the Advanced tab. Check the box labeled 'Show Develop menu in menu bar.' You should now see the Develop menu; if you activate it, you'll see a number of options for disabling certain web features, including CSS and JavaScript. Now you can use the Keyboard System Preferences panel to assign keyboard shortcuts to anything in this menu, as you would with any other menu item. I assigned Shift-Command-S to Disable Styles, and Shift-Command-Option-S to Disable Javascript. Obviously, you can create shortcuts for anything else in the Develop menu using the same technique.

[robg adds: I extensively modified the above hint, shortening it quite a bit and rewriting the how-to section. If you'd like more details on precisely how to create the keyboard shortcuts, including screen shots of each step, you can read the original version of the hint in the author's blog entry.]
  Post a comment  •  Comments (3)  
  • Currently 1.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[11,248 views]  View Printable Version
Disable single-click URL selection in Firefox 3 Web Browsers
When the user single-clicks in the address bar in Firefox 3 (currently at RC1 -- download | end user features), the default behavior is to select the entire contents of the address bar. The expected behavior for most other OS X browsers, including Firefox 2, is to insert the cursor at the click location. To restore Firefox 3 to sanity:
  1. Type about:config in the Address Bar and press Enter.
  2. If you get a message warning you about changing advanced settings, click "I'll be careful, I promise."
  3. Locate the preference named browser.urlbar.clickSelectsAll and double-click it to change its value to false.
That's it. Firefox should be back to it's old behavior. Note that you can still double-click the Address Bar to select a word, and triple-click to select the entire URL.
  Post a comment  •  Comments (12)  
  • Currently 3.27 / 5
  You rated: 5 / 5 (11 votes cast)
 
[9,677 views]  View Printable Version
Bypass DNS timeouts in Safari via AppleScript Web Browsers
For some reason, Apple has given Safari very little patience in waiting for DNS queries -- it quite often gives up on a query and won't load a page, even though that page will load fine in Firefox or another browser. If you need to use Safari, though, you can use this script to look up the IP address of the site and load the page using that instead:
(*
    Bypass DNS in current tab © RickoKid 2008
    Version 0.1
  
    This script was written to get around the annoying way that Safari
    gives up very easily when waiting for a DNS lookup, but command
    line DNS lookups still work fine.
  
  
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*)

tell application "Safari"
  set webURL to ""
  set webPath to "/"
  
  set currentTab to current tab of window 1
  
  if (name of currentTab is not "Untitled") then
    set webURL to URL of currentTab
  else
    set failedWin to text of currentTab
    if failedWin contains "Safari can't open the page" then 
      set webURL to text ((offset of """ in failedWin) + 1) thru ((offset of """ in failedWin) - 1) of failedWin
  end if
  if webURL is equal to "" then set webURL to text returned of (display dialog "Website to visit (bypassing DNS)" default answer webURL)
  set webServer to webURL
  if webURL contains "//" then set webServer to text ((offset of "//" in webURL) + 2) thru -1 of webURL
  if webServer contains "/" then
    set webServer to text 1 thru ((offset of "/" in webServer) - 1) of webServer
    set webPath to text ((offset of webServer in webURL) + (length of webServer)) thru -1 of webURL
  end if
  set websiteIP to my nslookup(webServer)
  set newURL to ("http://" & websiteIP & webPath) as string
  log "webServer:" & webServer
  log "webPath:" & webPath
  log "websiteIP:" & websiteIP
  log "newURL:" & newURL
  
  set URL of currentTab to newURL
end tell

on nslookup(address)
  set rawResult to (do shell script "host " & address & "| head -n1")
  set AppleScript's text item delimiters to space
  set parts to text items of rawResult
  return last item of parts
end nslookup
The easiest way to use it is to add it to your Safari script menu (by putting the script file in your user's Library » Scripts » Applications » Safari folder; create the folder if necessary). You can then select it from the Scripts menu when you're trying to load a page that seems to be stuck.

Be warned, though, that sometimes the page still won't load due to virtual server redirections that happen silently when given a DNS name. (This script was originally posted in this entry on my blog.)
  Post a comment  •  Comments (4)  
  • Currently 1.86 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[9,103 views]  View Printable Version
Use Script Editor to develop bookmarklets Web Browsers
If you're developing a non-trivial bookmarklet you may be able to speed up your edit cycle by having an applescript which executes the javascript in your browser, like this:
tell application "Safari"
  activate
  do JavaScript "
    // Of course your bookmarklet code goes here, for example...
    alert('hello world');
  " in front document
end tell
I just edited the Javascript in Script Editor and hit the run button to test. Just be careful of using double quotes, and you can postpone escaping the script and adding it to your bookmarks until the very end.
  Post a comment  •  Comments (1)  
  • Currently 1.57 / 5
  You rated: 2 / 5 (7 votes cast)
 
[6,525 views]  View Printable Version
Access Sprint Family Locator site with Safari Web Browsers
If you are like me and love using Safari as the default browser and also subscribe to Sprint's Family Locator service, you may have to switch to Firefox in order to access their website.

Not the case anymore. You must first enable the Develop menu in Safari, which you can now do in the Advanced section of Safari's Preferences panel. (Older versions must use the solution in this hint). Then click on the Develop menu in Safari, choose User Agent, and select the latest version of Firefox for Mac from the list before you log into the Sprint Family Locator website.

You will now be able to login and browse Sprint Family Locator website with Safari. So far, I have not noticed any features that don't work when using this workaround.
  Post a comment  •  Comments (3)  
  • Currently 1.20 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[10,790 views]  View Printable Version
Use Safari to find things more easily in text files Web Browsers
You can use Safari 3.x to open Text files (they must have .rtf or .txt extensions), and then use Safari's Find feature to locate what you're looking for in the file. The advantage is that you get Safari's wonderful new 'find' UI instead of just plain old search results or filtered text.

In context, This is how I use it. There are periods of time when I do a lot of searching through log files. In doing so, I'm often looking for a particular phrase, and I also need to see the log data around that time period. Using Console just doesn't cut it for me, because when I put the search term in, Console blocks out all other data in the file. Opening the log file in TextEdit will allow me to highlight each hit individually, which is better, but still not perfect.

When I use Safari, however, it highlights all of the hits, and grays-out the other text. This allows me to quickly find associations between the search phrase and other things happening at that time. Of course, as mentioned, I do have to get the data into a .txt or .rtf file to do this, but hopefully, Safari will support other plain text extensions in the future. (Right now, if you try to drop a .log file on Safari, it will show you where it is in the Finder.)
  Post a comment  •  Comments (16)  
  • Currently 2.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[9,543 views]  View Printable Version
Disable the WebKit default home page Web Browsers
In my job, I jump between browsers quite regularly, usually Firefox, Camino, and Safari. As we've covered here before in various hints, you can actually run a "future" version of Safari by downloading and installing WebKit, which is a special version of Safari using newer builds of the WebKit web browser engine. WebKit builds can be faster than the currently-released version, and have bug fixes and new features that you can take advantage of. As one example, the WebKit version of Safari currently passes the Acid3 browser test with a perfect score, while the released version of Safari scores a 75 out of 100.

One minor issue with using WebKit, however, is that it sets the default 'new window' page to this page, which thanks you for helping test WebKit, and lets you know there's a new nightly build available. This constant reminder helps insure that the WebKit team doesn't get bug reports against older nightly builds, but it gets annoying relatively quickly. (As a side hint, you can use NightShift to automatically download and install new nightly builds; highly recommended.)

If you'd like your Safari home page back while using WebKit, you'll need to use a simple Terminal command, which is documented on this page on the WebKit site (quit WebKit first):
defaults write org.webkit.nightly.WebKit StartPageDisabled -bool YES
Relaunch WebKit, and it will now respect your home page setting, as set in the General tab of WebKit's Preferences panel.
  Post a comment  •  Comments (5)  
  • Currently 2.17 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (6 votes cast)
 
[11,312 views]  View Printable Version