Would anyone mind writing a review of my youtube alternate player Firefox extension? It needs a review to be taken out of the “sandbox” area.

All you have to do is register an account on mozilla, then install the extension and try it out.

Note: if you don’t like the extension or if something doesn’t work properly, feel free to include that in the review (an honest review is better).

Cheers.

February 29th, 2008Youtube HD

I’m not sure if this is old news, but if you add &fmt=18 to a youtube video URL it’ll show a higher quality version of the video.

Here’s a greasemonkey script to automate the process: http://userscripts.org/scripts/show/23366

Go to the C:\Program Files\Common Files\Adobe folder.

Make a copy of the Updater5 folder and rename the copy to Updater.




Update: Version 1.4 released.

1.4 Changes:

  • Fixed the fullscreen glitch

1.3 Changes:

  • Is now compatible with Firefox 3
  • Made the status-bar menu simpler

1.2 Changes:

  • Removed bundled VLC Portable and Wimpy
  • Added stop button preference for Flowplayer
  • Removed .flv extension for flow player as it sometimes stuffed up the stream (you can still download the video as an .flv)
  • Added a restore function that restores the original player for the current page

Download here: http://forboden.com/js/youtubealternateplayer.xpi
Or here: https://addons.mozilla.org/en-US/firefox/addon/6522

Description:
This extension replaces the default youtube player with either flowplayer (pic below)

or JW FLV Media Player (pic below)

You have the option of selecting which player to choose from within the extension preferences window:

You can also download and save the video using the status bar menu.

AFAIK, there are two methods for copying text to the clipboard via Javascript in Firefox:

1: Using the nsIClipboardHelper, which requires the user either accept a security dialogue box or alter their prefs.js file. [See]

2. Using a flash file that passes the copied text to the flash file via the flashvars property. [See]

The problem with option 1 is that it requires user intervention to get it to work. The problem with option 2 is that by using the flashvars property, you run into issues with special characters (despite using escape() or encodeURIComponent()[See] ). [See the comments section on this page]

You can get around this by using the ExternalInterface.addCallback method in the Actionscript of your flash file. This allows you to pass text to the flash file without escaping or URI encoding.

An example:
(The HTML)

  

(The Actionscript)

import flash.external.*;var methodName:String = "saveEdit";
var instance:Object = null;
var method:Function = svEd;
var wasSuccessful:Boolean = ExternalInterface.addCallback(methodName, instance, method);     

function svEd(clipboard) {     

System.setClipboard(clipboard);     

}

Note: If your flash file is hosted on a different domain, you may have to add

System.security.allowDomain("http://siteflashfileishostedon.com");

…to your Actionscript. [See]

Further info:

The actionscript goes in a flash file. I’ve uploaded a flash file with the actionscript in my post here: clipboard.zip

Just upload the flash file to your site and put this in your HMTL:

and then call it with the following javascript:

document.clipboard.saveEdit(stuffToSave);

1. Go to about:config in Firefox’s address bar.

2. Enter browser.sessionstore.enabled in the filter and then change the value to “true”.

3. Enter browser.sessionstore.max_tabs_undo in the filter and change the value to however many closed tabs you want Firefox to remember.

December 3rd, 2007From Javascript to Python

I started playing around with Javascript because of Greasemonkey (you can check out my greasemonkey scripts here ).

Unfortunately (but rightly so), one of the limitations of Javascript is that you’re unable to write to a user’s hard drive because of security issues, so I figured I’d need to learn a new programming language that would allow me to do that.

Since Javascript is a scripting language, I thought I may as well choose another scripting language in order to make the transition from Javascript a little bit easier. I settled on either Tcl/Tk or Python as they both seemed to have a similar syntax to Javascript.

I eventually chose Python because of the free online book http://www.diveintopython.org/. I had previously used Mark Pilgrim’s excellent http://diveintogreasemonkey.org/ online book to learn Greasmonkey/Javascript/DOM.

After getting through about four chapters in diveintopython.org, I realised the pace of this online book was a little different. It seems to go from 0-100 very quickly. It’s a good tutorial, just a little too much for a Python n00b like myself.

I had a look on Amazon.com and found Python Programming for the Absolute Beginner. This book has turned out to be exactly what I was after. I highly recommend it if you’re just starting to learn Python.

The other minor issue I had when starting to learn Python was finding a good IDE. I finally settled on Eclipse with the Pydev plugin. You can see a video of Eclipse with the PyDev plugin in action here.

November 17th, 2007Regex sucks ass

So yeah, regex sucks teh big one!1. Why the fuck is the syntax so fucking cryptic? Someone should write a javascript regex library in the style of jQuery. Sure it wouldn’t be as expressive as head fuck regex, but for people that want to do some simple match/replace stuff or even basic lookahead/lookbehind shit.

It could go something like this:

 $R.start('wordstart').end('wordend'­).contain('blah').notcontain('meh');

and for basic lookahead/ lookbehind , maybe summin like this:

 $R.start('wordstart').end('wordend'­).pre('blah').post('meh');

For lazy quantifiers, you could do summin like this:

$R.start('wordstart').end('wordend:first'­);

iKon Wordpress Theme by TextNData | Powered by Wordpress |