Vimeo fullscreen link

Because the user videos do not load in Firefox 4, add a link to the fullscreen version the bottom

  1. // ==UserScript==
  2. // @name Vimeo fullscreen link
  3. // @namespace vimeo.armeagle.nl
  4. // @description Because the user videos do not load in Firefox 4, add a link to the fullscreen version the bottom
  5. // @include http://vimeo.com/*
  6. // @version 0.0.1.20140705065009
  7. // ==/UserScript==
  8.  
  9. window.setTimeout(function() {
  10. var fullscreenUrlBase = "http://vimeo.com/moogaloop.swf?clip_id=";
  11. var objects = document.getElementsByTagName('object');
  12. if ( objects.length == 0 ) {
  13. return;
  14. }
  15.  
  16. var pattern = /player(\d+)_\d+/;
  17. var matches = pattern.exec(objects[0].getAttribute('id'));
  18. if ( matches == null || matches.length < 2 ) {
  19. return;
  20. }
  21. var fullscreenUrl = fullscreenUrlBase + matches[1];
  22. var link = document.createElement('a');
  23. link.setAttribute('href', fullscreenUrl);
  24. link.appendChild(document.createTextNode('View in fullscreen'));
  25. document.getElementById('meat').appendChild(link);
  26. }, 1000);