Ruffle Flash Player

Play flash (.swf) files

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name        Ruffle Flash Player
// @namespace   i2p.schimon.ruffle
// @description Play flash (.swf) files
// @homepageURL https://schapps.woodpeckersnest.eu/
// @supportURL  https://greatest.deepsurf.us/en/scripts/490282-flash-player-ruffle/feedback

// @copyright   2024, Schimon Jehudah (http://schimon.i2p)
// @license     MIT; https://opensource.org/licenses/MIT
// @match       file:///*
// @match       *://*/*
// @version     25.03
// @grant       none
// @icon        data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7imqE8L3RleHQ+PC9zdmc+Cg==
// ==/UserScript==

// Please help  https://openuserjs.org/garage/Help_making_ruffle_to_work
// @require     https://unpkg.com/@ruffle-rs/ruffle/ruffle.js

function activateRuffle() {

  // The @require directive will automatically load Ruffle, so no further action is needed.
  'use strict';

  // The following code is used as a backup system.
  let ruffleScript = document.createElement('script');

  // Use the CDN version of Ruffle
  ruffleScript.src = 'https://unpkg.com/@ruffle-rs/ruffle';

  document.head.appendChild(ruffleScript);

};

function infoBar() {
  let namespace = 'i2p-schimon-ruffle';
  let bar = document.createElement(namespace);
  document.body.append(bar);
  bar.innerHTML = '⚡ Activate Ruffle Flash Player';
  bar.title = 'Flash elements have been detected on this page. Click this bar to activate Ruffle player.';
  bar.id = namespace;
  bar.style.backgroundColor = '#37528c';
  bar.style.color = '#ffad33';
  bar.style.fontFamily = 'system-ui';
  bar.style.fontSize = 'larger';
  bar.style.fontWeight = 'bold';
  bar.style.right = 0;
  bar.style.left = 0;
  bar.style.top = 0;
  bar.style.zIndex = 10000000000;
  bar.style.padding = '6px'; //13px //15px //11px //9px //3px //1px
  bar.style.position = 'fixed';
  bar.style.textAlign = 'center'; // justify
  bar.style.direction = 'ltr';
  bar.style.userSelect = 'none';
  // set bar behaviour
  bar.onclick = () => {
    bar.style.display = 'none';
    activateRuffle();
  };
}

(function() {

  if (document.querySelector('embed[src$=".swf"]')) {
    infoBar();
  }

})();