Tag Archives | javascript

Jetpack Gallery

Gallery of Jetpack Add-ons

Do you remember Jetpack?

It is the Mozilla Labs project that makes the add-on building process easier, mixing elements of HTML, CSS and JavaScript.  Mozilla has released an awesome Jetpack Gallery, which serves as a community for Jetpack developers and add-on users.

Continue Reading →

Update: Firefox 3.5 First Fixes Are Ready

Firefox 3.5.1 Released

The first update to Firefox 3.5 has just been released.  To get the update right now, all you need to do is go to Help > “Check for Updates…” in your browser.  So what exactly is this new update fixing? 

Both the slow startups for Windows users and the JavaScript memory corruption flaws have been fixed.  After the update is in place, if you set javascript.options.jit.content to false via about:config, you can now go back in and set it to true again.

For more changes and updates in Firefox 3.5.1 – be sure to check out the release notes.

Introducing Jetpack for Firefox

Ever wanted to write your own Firefox extension, but thought the process was too drawn out or difficult to do?  Jetpack is looking to use open Web technologies to enhance the browser.  The idea here is that if you can make a web page, you will be able to build an add-on for Firefox.

This video does a great job at giving you a basic walk-though of what Jetpack development looks like thus far:

Mozilla Labs Jetpack – Intro & Tutorial from Aza Raskin on Vimeo.

Overall, I am really excited about this!  I always love to tweak away at Firefox using tools like Greasemonkey and Stylish (which Jetpack reminds me of, in a sense of being simple ways to extend the browser).

Word of warning, this is an extremely early release of the software, that is still being designed and developed.  This version that is out now is pretty much just for the developers and testers who want to start getting their hands dirty.

Grab Jetpack, and play around with it yourself.  It might not be for everybody, however should really help to inspire those of us who like to tweak around with our browser to make it work for us.

Resize and Reposition Your Browser with JavaScript

resize-browser Don’t you have it when you have lost your perfect spot for your browser window in your desktop layout and you have to put it back by dragging it over, then resizing each corner till it is back in that perfect spot yet again?  Well, with the help of a little JavaScript you can take the mess out of resizing and repositioning your browser.

Why Resize and Reposition Firefox Automatically?

When working I usually like to keep up a chat window, a notepad program and Firefox.  The notes and chat can stay a little smaller, stacked on top of each other on the side but Firefox needs to be in the left over big space.  So this is the JavaScript I used to put in in its spot:

javascript:resizeTo(1024,1000);self.moveTo(640,10);

That says to keep the browser 1024 in width, 1000 pixels high and to move to to the desktop location of 640 pixels left and 10 pixels down.  If you used:

javascript:resizeTo(1024,1000);self.moveTo(0,0);

That would set it up to be in the top left corner.  Depending on your screen size those last two numbers are what you want to change to get the position right and the first two number would be your browser size.  There is probably some mathematical way to figure out the right number for the position you want – but if your like me you just changed the numbers around till you got it in the position you need.  What if you wanted the browser height to be all the way from the top of the screen to the bottom?  In that case you could change the second number in resizeTo (in both examples that would be the 1000) to screen.availHeight.

javascript:resizeTo(1024,screen.availHeight);self.moveTo(0,0);

Notice now that by copy and pasting this into your address bar and hitting enter will make the browser as tall as it can be, with the width of 1024 pixels and in the left side of the screen.

How do You Create the Resizing Bookmark?

Now how can you create a bookmark to do this in Firefox?  Simple.  Right-click on your bookmarks toolbar, and select “New Bookmark”.  Name can be anything.  I call mine – Resize Browser.  Location is where you want to type in the JavaScript string above.  In keyword, type in a simple tag such a “r” or “resize”.  That way when you type in “r” into the address bar – it will automatically resize Firefox back to your perfect location.   Description can be left blank.  Hit the Add button, and you are done.

In the memory of every great cooking show I have ever seen, let me take a page out of their book and give you a link to drag into your bookmark toolbar so you can see the effects of this simple desktop organizational hack:

Now I know somebody will bring up the fact that a number of extensions will do this same action too.  This provides a way of simply adding the feature in without the need of another add-on.

javascript-settings Having Problems? 

To use these JavaScript tips, remember you have to have JavaScript enabled in your Firefox options.  Go to Tools > Options and then the Content Tab.  Make sure there is a check mark next to “Enable JavaScript”.  Also, in the Advanced settings be sure to allow scripts to move or resize existing windows.

With a little help from JavaScript and some creativity you will never lose your favorite browser size on your desktop.

TraceMonkey

Thanks to a new JavaScript engine (named TraceMonkey) it looks as if Firefox 3.1 is going to be getting a major boost in performance.

Here are the benchmarks thus far:

assorted-benchmarks

Be sure to check out Brendan’s Roadmap Updates for more.  Also here are a few handy links from John Resig on the testing:

So the big question is, will Firefox be able to make Firefox 3.1 even faster in the area of JavaScript?  If you have the nightly build of Firefox 3.1 installed, you can turn TraceMonkey on by going to about:config and then toggle the javascript.options.jit.content setting from false to true.  For the rest of us out there though, this is just one more surprise to look forward to once Firefox 3.1 gets rolled out to the public.

For more info, be sure to check out Firefox 3.1 to Get More JavaScript Speed Optimizations – as the CyberNet team had done a good in-depth look into this and has done the best job at making it make sense to everybody.

Tell JavaScript What it Can and Can Not Do

Controle de Scripts is an add-on for Firefox that allows you to control what JavaScript on a web site can (or can not) do to your browser.  Here is a little more about the extension from the developer:

control-javascript-firefox

Besides the well-known basic permissions, like hiding toolbars or raise or lower windows, with Controle de Scripts you can set what functions or properties each site can access or modify, thanks to its Security Policies implementation.

Think of it as the regular permissions for JavaScript (setup by going to Tools > Options > Content and then the “Advanced” button next to “Enable JavaScript”) on steroids.  Some say these are the tools Firefox should provide by default – and now you can at least add them on for good measure.

Pickup Controle de Scripts via Mozilla Add-ons Site or the official site for this awesome JavaScript controlling addition to the browser.

5 Ways to use Firefox to Filter the Web

firefox-safety We are always talking about adding features to Firefox, what about for those people who would like to take them away?  Better yet, how about adding features that let you take other features away?  Ok, now I am even confusing myself. 

Firefox has some great add-ons to use when it comes to blocking, filtering or checking out the sometimes shady information that may be passing through it.

LeechBlock – This extension is much more for saving you from looking at random stupid links when you should be working.  If you can not keep yourself focused, you may need to add this to your own Firefox install.

Flashblock – Tired of seeing the offers to punch President Bush, the Pope or any other important person to win an iPod?  The Flashblock add-on has your back as it will block all flash until it is told not to.

Adblock Plus – How could you not love Adblock Plus?  Filter out the ads you don’t want to see – and automatically subscribe to filters so you don’t waste time setting these things up yourself.  Not to mention, I did interview the creator of the script a few months back (very awesome guy!).

NoScript – NoScript allow JavaScript, Java and other executable content to run only from sites you trust.  Some feel it is better to browse the Web this way to make sure you don’t get bit by something nasty by randomly surfing through pages.

CookieSafe – This extension will allow you to easily control cookie permissions. It will appear on your statusbar. Just click on the icon to allow, block, or temporarily allow the site to set cookies.

Know of another blocking or filtering tool that does a better job?

Firefox Security Update to 2.0.0.14

Just got my update a short time ago, have you gotten yours.  Looks like Firefox 2.0.0.1.4 was released yesterday afternoon, and if you have automatic updates enabled in Firefox, you should be getting it yourself in 24-48 hours.  This looks to be like a critical security update because only one change mentioned in the release notes.  Wasn’t rolled in together with any other fixes.

Here are the details from Mozilla:

Fixes for security problems in the JavaScript engine described in MFSA 2008-15 (CVE-2008-1237) introduced a stability problem, where some users experienced crashes during JavaScript garbage collection. This is being fixed primarily to address stability concerns. We have no demonstration that this particular crash is exploitable but are issuing this advisory because some crashes of this type have been shown to be exploitable in the past.

To update you can activate your automatic updates, go to help and then “check for updates” or download the most recent version at getfirefox.com.

Firefox 3 is Faster Finally?

Firefox 3 has a lot of nice new features, the design is slick and it promises to be yet another Mozilla home run! Now a lot of people could really care less about those three facts because much of the Web is much more considered with how fast Firefox 3 is going to be. Well thanks to Ryan over at CybernetNews.com we have some numbers for you.

Using the SunSpider JavaScript Benchmark test for each of the browsers, here are the results from best to worst on who was the fastest around:

  1. Firefox 3 Nightly (PGO Optimized): 7263.8ms
  2. Firefox 3 Nightly (02/25/2008 build): 8219.4ms
  3. Opera 9.5.9807 Beta: 10824.0ms
  4. Firefox 3 Beta 3: 16080.6ms
  5. Safari 3.0.4 Beta: 18012.6ms
  6. Firefox 2.0.0.12: 29376.4ms
  7. Internet Explorer 7: 72375.0ms

Now before I get somebody mad because this is only a test of JavaScript, let me explain that this test is very relevant because there are tons of sites (thanks to Web 2.0) that heavily reply on it. To get more information on the research and information you can get from this study be sure to check it out over at CybernetNews.com.

Fixing Firefox Popup Annoyances

Two popup window annoyances that come up are when you yourself can not resize a window because the designer has locked it down to that one shape and size and when a web site resizes your windows or moves them around without asking. We will start with that one first.

Stop Resizing and Moving My Firefox Browser

Want to stop the ability for web sites to resize your browser window or move it around? In Firefox go to Tools, then Options the the Content tab. Where you see the check mark box for “Enable JavaScript” hit the Advanced button next to it. Here you can enable or disable the ability for web sites to resize or move your existing window.

Turn Back on My Ability to Resize Any Popup Myself

Now the second situation you might find yourself in is when you want to resize the window but the designer locked it down so that you can’t. Thanks to gHacks.net though for finding this next tweak, you can override the “cannot resize popup” setting when you run into popups that can not be resized.

There is however a way in Firefox to override the “cannot resize popup” setting which in turn makes it possible to resize any popup that you might come across. To do so you need to type about:config in the address bar of Firefox and filter for the term dom.disable_window_open_feature.resizable. Set the value of this setting to true to be able to resize all windows in Firefox.

Restart Firefox and you should be able to resize those popup windows on any web site.