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

Saving and restoring tabs in Safari Web Browsers

So, one day I needed to quit Safari for some reason. The problem was that I had a window with something like 10 tabs open and I needed those pages still. I really find it a pain that I have to bookmark each tab separately, otherwise I would just bookmark all the tabs at once and load them back up when I restarted Safari, but Safari doesn't do this.

I did a little searching and found some scripts on John Gruber's site that saved and restored windows in Safari. This looked good, but it didn't save/restore tabs in those windows. So starting with John's scripts, I added support for tabs to the save script. After learning about GUI Scripting I came up with the following -- read the rest of the hint for the scripts.

read more (677 words)   Post a comment  •  Comments (52)  
  • Currently 2.80 / 5
  You rated: 1 / 5 (5 votes cast)
 
[76,821 views] Email Article To a Friend View Printable Version
Stop all advertising banners in web browsers Web Browsers
I've made a summary with all information about CSS and ADS blocking. The result is an CSS file which, used as default style sheet, can hide all advertising banners in images, texts or animations format even embeded into javascript! This works of course with all browsers ...except Internet Explorer! But who cares?

You can find the stopADVbanners.css file on my website. Just save this file on your hard drive then open the preferences panel of your favorite browser (Mozilla, Netscape, Apple Safari, Opera, etc) and choose this file as "preferred style sheet".

Some very easy CSS tricks I used:
/* disable ad image linking to advertising script */ 
A:link[HREF*="doubleclick"] IMG,

/* disable ad texts linking to advertising script */ 
A:link[HREF*="?banner"],

/* disable Flash banner ads */ 
embed[type*="shockwave"][width="468"][height="60"], 
object[codebase*="shockwave"][width="468"][height="60"],

/* disable ad iframes */ 
IFRAME[SRC*="valueclick"],

/* disable ADV images as specified by www.iab.net */ 
*[width="468"][height="60"], *[width="468px"][height="60px"]

{ display: none !important; visibility: hidden !important; }
[robg adds: Here's my obligatory webmaster comment ... if you block all ads all the time, those sites that rely on ad revenue may eventually start charging for access (see recent warnings on Macintouch, MacSurfer, etc.). I leave most ads enabled, only blocking pop-ups and highly annoying Flash ads, and occasionally buy stuff via click-throughs just to support my favorite sites ... one could argue the merits of the advertising-supported web model forever, though, and this hint does provide some good solutions to blocking highly annoying ads.]
  Post a comment  •  Comments (32)  
  • Currently 3.40 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[36,752 views] Email Article To a Friend View Printable Version
An overview of Mozilla preference files Web Browsers

You can pre-configure Mozilla so that all users get the same preferences when they create a new profile. For example, you might want to define a preference for /tmp, or /Users/Shared as the cache directory, so that users with network home directories will use the local drive for cache.  These prefs are stored in a javascript file called user.js which needs to be saved to /Applications -> Mozilla.app (control-click and select "Show Package Contents") -> Contents -> MacOS -> defaults -> profile -> US -> user.js. In your user.js file, lines which begin // are comments, so you could enter, for example:

//
// user.js: Personal prefs which mozilla shouldn't overwrite.
//
user_pref("browser.startup.homepage", "http://www.my.server.edu/");
user_pref("intl.accept_languages", "en-au, en, en-us, zh, zh-cn, zh-hk, zh-sg, zh-tw, fr, de, de-de, de-at, it, ja, pl, ru, es, sv, fi, sr, hr, da, nl, fr-ca, fr-fr, id, in");
user_pref("intl.charset.default", "UTF-7");

Note that user.js has unix line endings, so use a command line text editor, like vi or pico for editing ... or use BBEdit with the appropriate setting.
read more (270 words)   Post a comment  •  Comments (2)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[4,723 views] Email Article To a Friend View Printable Version
macosxhints and versiontracker searches for Mozilla Firebird Web Browsers
I have made some search plugins for the MacOS X Hints and Versiontracker lovers who use Mozilla Firebird as their default browser. The search plugins enable you to search within Mozilla Firebird by using the search box -- each site appears as a new option in the drop-down menu under the magnifying glass in the search box.

You can download the plugins from the macosxhints' download collection -- Search Plugins (4KB). After downloading and expanding the archive, you can install the extensions by control-clicking on Mozilla Firebird. Select Show Package Contents from the pop-up menu, and then navigate to Contents -> MacOS -> searchplugins in the new window. Copy the contents of the downloaded SearchPlugins -> Plugins folder into the searchplugins folder, and launch Mozilla Firebird. You should now have two new search engines in the drop-down menu in the search box.

[robg adds: I tested these, and they work as described, allowing easy searches of both macosxhints and versiontracker.]
  Post a comment  •  Comments (4)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[4,041 views] Email Article To a Friend View Printable Version
Safari and Javascript debugging Web Browsers
Want an easy way to debug Javascript?
  1. Activate the debug menu in Safari, either by using the excellent Safari Enhancer or by shell command defaults write com.apple.Safari IncludeDebugMenu 1
  2. Check the option "Log JavaSript Exceptions" in the Debug menu
  3. Check your Console.app and there is your output!
[robg adds: Mozilla also has access to a Javascript debugger in the Tools -> Web Development menu.]
  Post a comment  •  Comments (4)  
  • Currently 2.40 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[45,400 views] Email Article To a Friend View Printable Version
Possible Safari fix for misbehaving websites Web Browsers
I enabled the debug menu in safari using a hint I found here about a week or so ago.

I frequently visit some site that are aware that they do not fully function with Safari for some reason or another. Most of these sites involve shopping carts or other assets management functions. One example would be Photospin.com -- if you have an account, you would not be able to download anything using Safari. Your account would think you were not logged in any more once you left the original login page. If you would try to log back in, it would tell you your account was in use. This never happens when using Opera or Internet Explorer.

Well today I got to fiddling around in the debug menu and changed my user agent from "Automatically Chosen" to "Mac MSIE 5.22" -- and it worked. My misbehaving websites all function properly now. What I have noticed is that this seems to work on a site by site basis. I am using four tabs right now, and am able to set a different user agent to each one.
  Post a comment  •  Comments (15)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[12,703 views] Email Article To a Friend View Printable Version
View image dimensions from Safari Web Browsers
Today I found out how to get an image file's dimensions from within Safari, and I thought I'd share. You'll need the Debug menu enabled.
  1. Load the image into its own window (or tab). If the image is embedded in within a document, control- (or right-) click on it and choose "Open Image in New Window."

  2. Go to the Debug menu and select "Show View Tree." Option-click on the disclosure triangle next to the only visible line.

  3. The last row of the "Width" and "Height" columns should tell you the image's dimensions.
If all you need are the dimensions of a current image, this will save some time over the "drag to desktop, open in photo application" process.
  Post a comment  •  Comments (9)  
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[13,631 views] Email Article To a Friend View Printable Version
Edit the default window size of new Explorer windows Web Browsers
For the last couple of months, all new windows I opened in Internet Explorer were really small, with a width of about one quarter of the screen, and showed up on the right side of the screen. Trashing Explorer preferences did not fix it since, as I found out today, the default window size for the Explorer is stored in com.apple.internetconfig.plist found in ~/Library -> Preferences. Instead of just trashing this file, which would have required resetting of a lot of preferences, I tried to find the relevant line and just change it.

To do this, first quit Explorer, open the .plist file with the PropertyList Editor (should be the default if you have the Dev Tools installed), open the first three triangles, scroll down to 'InternetExplorerWindowPosition' and open its triangle. The second block of numbers sets the window size; in my case they looked like: 031c045a, 31 sets the height of the window, 45 the width. Change the numbers, save the file, restart Explorer.

Now if someone could find out where the size of windows resized with the green button is set, I would be happy!
  Post a comment  •  Comments (14)  
  • Currently 1.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[21,876 views] Email Article To a Friend View Printable Version
Calculate values in Safari courtesy of Google Web Browsers
... well kind of! Google has launched a calculator function (Google calculator) which also works very nicely from the Google search field built into Safari.

Fire up Safari and type an expression into the Google search field. Hit enter and Google gives you the result. As well as simple arithmetic (eg 5+2*2), it can also do more complex stuff like sine(30 degrees) or e^(i pi)+1. It knows about physical constants and can also handle conversions for example, 100 miles in kilometers or 160 pounds * 4000 feet in Calories.

[robg adds: Obviously, you can do this from any application that accesses Google; it works really well with the pop-up search engine front-ends such as Searchling and Huevos.]
  Post a comment  •  Comments (16)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[7,409 views] Email Article To a Friend View Printable Version
Save text snippets as bookmarks in Mozilla Firebird Web Browsers
I just realized that you can save small pieces of text as bookmarks in Phoenix (Mozilla Firebird).

I have a folder in my bookmarks bar, by accident I drag'n'dropped a pieces of text from webpage to this folder (I intended to release the mouse button over the desktop to create a clipping) and interesting enough, a "bookmark" was created with all text in the first paragraph of the text dragged. Of course, this is not a valid bookmark, however it can be very useful to store small snippets of text from webpages (e.g., phone numbers).

[robg adds: This only works for short text snippets, as you can't load the clipping -- it seems to display the first 30 to 40 characters or so.]
  Post a comment  •  Comments (1)  
  • Currently 2.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[3,945 views] Email Article To a Friend View Printable Version