Some information that might be of use to someone, at discount prices.

June 4, 2005

Netflix Queue Manager for Greasemonkey

Category: Movies,Netflix,Software — badsegue @ 1:50 am

background

Greasemonkey is a Firefox extension that runs javascript code on the current browser page. It is used to change the behavior of a web page usually by adding functionality, or altering the appearance. It is quite analogous to the bookmarklet model. The difference is that a Greasemonky script can be invoked automatically whenever a certain page is visited, while a bookmarklet must be invoked by the user.

With Greasemonky any site-specific bookmarklet can be adapted to run automatically when that site is visited. Here we provide an adapted version of the Netflix Queue Manager.

It is not necessary to have Greasemonkey to run the Netflix Queue Manager. Using the Greasemonkey version won’t save you any time–either way it is one click away. The only advantage is being able to remove a bookmark from your toolbar or favorites list.

installation

If you have Greasemonky installed just use this link:

Netflix Queue Manager for Greasemonkey

Right-click and select “Install User Script” or click the link to view the file then select “Tools->Install User Script”.

implementation

This is relatively simple. Minimally the bookmarklet link just needs to be encapsulated into a file so that Greasemonky can install it. This works, but the Manager will be invoked automatically on the Queue page. This is undesirable because it will always appear after the page is updated.

To defer the Manager launch, the new script adds an highly visible link near the top of the page. The link appears whenever you visit your Netflix queue. Just click the link to start the Manager.

The original script in netflix-manager.js is unchanged. The original bookmarklet code is just wrapped in a function that is called when the new link is clicked.

(function(){

  window.launch_manager = function() {
	  var script=document.createElement('script');
	  script.src='http://badsegue.org/samples/toolman.js';
	  document.getElementsByTagName('body')[0].appendChild(script);
		
	  var script=document.createElement('script');
	  script.src='http://badsegue.org/samples/netflix-manager.js';
	  document.getElementsByTagName('body')[0].appendChild(script);
  }

  var h = document.getElementById("header");
  var d = document.createElement("div");  
  d.style.border = "2px dashed cyan";
  d.style.backgroundColor = "orange";
  d.innerHTML = "<a href='javascript:launch_manager()'>Launch Netflix Queue Manager</a>";
  h.appendChild(d);
}
)()
• • •

No Comments

No comments yet.

Comments RSS

Sorry, the comment form is closed at this time.