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

Use normal and private browsing at the same time in Firefox Web Browsers
I had always thought that Chrome's method of private browsing, which allows you to intermingle private and normal browsing in separate windows/tabs, was better than Safari or Firefox, which are an all-or-nothing proposition. Now Firefox, at least, can emulate Chrome's behavior.

With the Firefox add-on Private Browsing Window, the user can have private and normal browsing windows simultaneously. This can be used for things other than simply secure browsing, too. You could, for instance, log into two Gmail accounts simultaneously, or test a web app using two different accounts in one browser.
  Post a comment  •  Comments (1)  
  • Currently 2.47 / 5
  You rated: 5 / 5 (17 votes cast)
[11,276 views]  View Printable Version
Automatically zoom new pages in Safari Web Browsers
Safari has a nice feature to zoom in (or out) on a webpage, which is great for large monitors. Unfortunately, you're not able to set a default zoom level for new pages. CSS hacks exist, but zooming via CSS doesn't seem to work as well as the native zoom function in Safari. The AppleScript in this hint zooms in on any new web page using Safari's own zoom function.

The script is quite a hack -- it checks every tenth of a second to see if the currently active tab isn't zoomed in. If it's not zoomed in, the script activates the corresponding keyboard shortcuts to zoom the page. You can edit the script to change how often the zoom-check should be made, and what level of zoom should be made.
  try -- we have to try, since safari might not be running, and theUrl might not be defined
    if frontmost of application "Safari" then
      tell application "Safari"
        set theUrl to URL of current tab of window 1 -- window 1 is apparently always the active window in Safari
      end tell
      if theUrl is not "" then -- this will ignore new tabs where a page is not yet loaded
        tell application "System Events"
          tell process "Safari"
            -- these may differ according to the OS X language
            set activeMenuItem to enabled of menu item "Actual Size" of menu "View" of menu bar item "View" of menu bar 1
          end tell
          if not activeMenuItem then
            -- here we fire off the key shortcuts 
            -- these may differ according to the OS X language
            keystroke "+" using command down
            keystroke "+" using command down
          end if
        end tell
      end if
    end if
  end try
  delay 0.1 -- how many seconds to wait until next check
end repeat
With a delay of 100ms, the scripts gobbles 1% of the CPU time on my system. One idea is to make an application from the script, and launch that instead of launching the script directly from the AppleScript Editor. Any suggestions for improvement are welcome!

[robg adds: I tested this in 10.6.2 on a MacBook Pro, and the script used about 5% of the CPU. It did, however, work as described.]
  Post a comment  •  Comments (7)  
  • Currently 2.42 / 5
  You rated: 3 / 5 (24 votes cast)
[12,870 views]  View Printable Version
Programmatically change URLs for Opera Speed Dial links Web Browsers
I like to keep a weather page from Wunderground on my Opera speed dial. The monthly summary page contains the information I'm seeking (moon phase and sunrise/sunset). However, the URL contains a date, and the page displays information for that date. I was changing the date manually once a month, but this method doesn't show accurate daily information. So, I wrote a perl script that changes the date every day. I use cron to run the script at midnight every day (I hate launchd; it's overly complicated).

Opera stores information about Speed Dial links in a text file located at ~/Library » Preferences » Opera Preferences » speeddial.ini. This script closes Opera and changes the date in the URL in the speeddial.ini file.
read more (110 words)   Post a comment  •  Comments (7)  
  • Currently 1.94 / 5
  You rated: 2 / 5 (16 votes cast)
[8,118 views]  View Printable Version
Re-enable text-only zoom in Safari Web Browsers
While reading a recent hint submission by cooter, I realized that Safari on my Mac Pro wasn't capable of zooming just the text on a web page -- regardless of the setting of the View -> Zoom Text Only menu item, Safari would always zoom both the text and the graphics. This didn't happen on my MacBook Pro, so I suspected some previously-tested hint was interfering with Safari on the Mac Pro.

After a bit of searching, I found the culprit: Implement full page zoom in the WebKit browser. A quick check in Terminal...

defaults read | grep WebKitDebugFullPageZoomPreferenceKey

...confirmed that this value was set for Safari on the Mac Pro, and not on my MacBook pro. The solution was simple -- quit Safari and delete the troublesome key in Terminal:

defaults delete WebKitDebugFullPageZoomPreferenceKey

On relaunch, Safari once again respected the setting of the Zoom Text Only menu item. (This key causes the same problem in Safari in both 10.5 and 10.6, though I'm not sure if the key survives an upgrade from 10.5 to 10.6 -- my Mac Pro is still running 10.5.8.)
  Post a comment  •  Comments (5)  
  • Currently 2.16 / 5
  You rated: 2 / 5 (19 votes cast)
[9,182 views]  View Printable Version
Convert non-clickable links to clickable links Web Browsers
This bookmarklet will convert "cold-links" (i.e. URLs which do not link) into clickable hotlinks. This is from the collection of bookmarklets, where you can find a number of other potentially useful bookmarklets.

Create a new bookmark with a name like Linkify, and use the following text as the address (or whatever your browser labels the URL field):
I added this to my Safari bookmarks bar at the far left, so I can invoke it just by hitting Command-1.

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (7)  
  • Currently 2.68 / 5
  You rated: 1 / 5 (19 votes cast)
[10,721 views]  View Printable Version
Enable extensions in Chromium (or Chrome) Web Browsers
Chromium (and Chrome) has lots of useful features that can only be enabled via command line switches when launching, such as extensions, user script support, and bookmark sync.

Rather than launch via the command line every time, I use the following script to patch the --enable-extensions command line arguments into the application bundle itself:
# Patches the Chromium application installation with command line arguments to enable extensions.
set -o errexit
cat >$app/Contents/MacOS/Chromium.wrapper <<EOF
exec $app/Contents/MacOS/Chromium --enable-extensions "\$@"
chmod 755 $app/Contents/MacOS/Chromium.wrapper
defaults write $app/Contents/Info CFBundleExecutable Chromium.wrapper
Additional arguments that can be useful are --enable-sync and --enable-user-scripts.

[robg adds: To use the above, save it in Terminal text editor, make it executable (chmod a+x scriptname), and then run the script. You can find Chromium Mac builds here, and this hint explains how to automatically update to the latest build. I tested this script, and it seemed to work with the latest build of Chromium. Note that the script assumes Chromium is in /Applications; if you have it elsewhere, you'll need to modify the app=... line.]
  Post a comment  •  Comments (11)  
  • Currently 2.74 / 5
  You rated: 5 / 5 (23 votes cast)
[51,388 views]  View Printable Version
How to remove locally-stored Flash 'cookies' Web Browsers
This may be old news, but I just found out about Flash Cookies (otherwise known as Local Shared Objects), and a way to delete them, and to prevent more from being created.

You can control Flash cookies via Macromedia's Flash Player Settings Manager, which is an actual Flash application you load in your browser (that is, the picture you'll see on that page is not an image; it is the actual Settings Manager).

Set Global Storage Settings to 0, and then select the Website Privacy Settings tab (the fourth tab from the left), and select Delete All Sites to remove prior-stored history.

Note that the 'cookies' are (or were) stored in ~/Library » Preferences » Macromedia » Flash Player » #SharedObjects, and the settings are stored in ~/Library » Preferences » Macromedia » Flash Player » » support » flashplayer » sys.
  Post a comment  •  Comments (7)  
  • Currently 3.20 / 5
  You rated: 3 / 5 (35 votes cast)
[50,181 views]  View Printable Version
A possible solution for system hang on Safari launch Web Browsers
Recently, any time I tried to run Safari on 10.6 caused all apps and the Finder to hang with the spinning beach ball. Force-quitting Safari stopped the problem, but it would occur again on the next launch. Googling around, I saw many folks reporting similar problems, but no solutions.

The /var/log/system.log file shows something like this when this hang occurs:

Nov 13 09:51:16 bvmbook Safari[394]: INSERT-HANG-DETECTED: Tx time:46.498542, # of Inserts: 0, # of bytes written: 0, Did shrink: YES

Sounds like a database problem. So I looked at which database-type files were opened by Safari, with this in Terminal:
sh-3.2# lsof / | grep Safari |grep db
Safari    544       vanetten  txt    REG   14,2     32768 3762252 /private/var/db/mds/messages/se_SecurityMessages
Safari    544       vanetten  txt    REG   14,2     51288 3764181 /private/var/folders/L2/L2wz7UsyFWOAKlDB6i6RqE+++TM/-Caches-/mds/mdsDirectory.db
Safari    544       vanetten  txt    REG   14,2 197840896 3762198 /private/var/db/dyld/dyld_shared_cache_x86_64
Safari    544       vanetten    5u   REG   14,2     36864 3764157 /Users/vanetten/Library/Safari/WebpageIcons.db
Safari    544       vanetten    6u   REG   14,2  39143424 2858942 /private/var/folders/L2/L2wz7UsyFWOAKlDB6i6RqE+++TM/-Caches-/
Safari    544       vanetten    7u   REG   14,2    724992 3764162 /Users/vanetten/Library/Caches/
I found that if I quit Safari and deleted the *.db files in my home directory, the problem goes away:
sh-3.2# rm /Users/vanetten/Library/Safari/WebpageIcons.db /Users/vanetten/Library/Caches/ /Users/vanetten/Library/Caches/
I'm not sure which of these files were corrupt, but launching Safari seems to re-create them.
  Post a comment  •  Comments (4)  
  • Currently 2.43 / 5
  You rated: 3 / 5 (28 votes cast)
[14,812 views]  View Printable Version
Set Firefox profile directly within the application bundle Web Browsers
I share a computer with my wife (using one account), and we both use Firefox and many of the same services (Gmail, Facebook, etc.). As such, it can be quite a hassle to keep track of who logged in last and who added what bookmarks.

Fortunately, Firefox provides the capability to have separate profiles for just such a situation. Unfortunately, it is not very simple to set up an easy and consistent way to launch those profiles. So, here are some of the options I tried before arriving at what I think is a pretty good solution.
read more (738 words)   Post a comment  •  Comments (17)  
  • Currently 1.94 / 5
  You rated: 2 / 5 (17 votes cast)
[7,823 views]  View Printable Version
Zoom Firefox windows via scroll wheel Web Browsers
Firefox (versions 3.5 and up, at least) has the ability to zoom in and out of a web page, adjusting both text and graphics, without affecting the rest of the screen. You can access this feature via the menus (View » Zoom In or Zoom Out), and via the noted keyboard shortcuts (Command-equals to zoom in; Command-minus to zoom out; Command-0 to reset).

What you may not know is that you can also zoom via your mouse's scroll wheel. Press Control-Command (Control-Option also works) and move the scroll wheel up or down. The browser window will zoom in or out while maintaining, for the most part, the clarity of the text and images. The rest of the screen does not change.
  Post a comment  •  Comments (1)  
  • Currently 3.04 / 5
  You rated: 4 / 5 (24 votes cast)
[8,478 views]  View Printable Version