Skip to content

Making a Greasemonkey Script for Embedded YouTube Videos Work with More Embedded Videos

As I have mentioned a number of times here before, I always appreciate receiving feedback about the software that I write. I need feedback from the users of my software in order to ensure that my software works as it should, and to know how I can make improvements to what I write. And I was recently informed that my Greasemonkey script that adds links below embedded YouTube videos to the pages on YouTube on which these videos can be found did not work with a video embedded on a particular page. A new version of the script that corrected this error was made available within twenty-four (24) hours of a comment being posted about this error. It was a very simple error that occurred as a result of me assuming that when an embedded video is added to a web page, few changes, if any, are made to the code one can copy and paste from the page on YouTube on which the video can be found. I later discovered on my own that this script had another similar error that occurred as a result of me making this assumption.

This second error was one that I discovered after Googling myself. This egosurfing indirectly led me to this page, which actually has information on this script. However, the page actually contains an embedded YouTube video to which my script did not add a link. After checking the parameters in the tags used to embed the video, I found that the .SWF extension was added to the end of the URL of the YouTube page where the video can be found. Therefore, I once again needed to update this script to handle a case that I did not think it would need to handle. Once again, however, only slight modifications needed to be made to correct this error.

This script has been publicly available for a long time. And during the time that it had been publicly available, errors like these had either not been found or were never reported. I certainly hope that the former rather than the latter is the case, for obvious reasons. However, in any case, I will try to decrease the number of pages on the web that have YouTube videos embedded in them with which this script will not work.