Spaces Full Screener

Takes spaces to full screen on the Huggingface site

  1. // ==UserScript==
  2. // @name Spaces Full Screener
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-02-26
  5. // @description Takes spaces to full screen on the Huggingface site
  6. // @author anonimbiri
  7. // @license MIT
  8. // @match *://huggingface.co/spaces/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=hf.space
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. const url = new URL(location);
  14.  
  15. if (url.href.includes('?fullscreen=true') || !url.href.includes('?fullscreen')) {
  16. url.searchParams.set("fullscreen", "false");
  17. history.pushState({}, "", url.href);
  18.  
  19. setTimeout(function () {
  20. var iframe = document.querySelector('iframe.space-iframe');
  21. window.location.href = iframe.src;
  22. }, 100);
  23.  
  24. }