Inject Ruffle (Flash Player)

自动注入 Ruffle 脚本到网页中,让 Flash 内容可以运行

目前为 2025-04-25 提交的版本。查看 最新版本

// ==UserScript==
// @name         Inject Ruffle (Flash Player)
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  自动注入 Ruffle 脚本到网页中,让 Flash 内容可以运行
// @author       You
// @license      MIT
// @match        *://*/*
// @grant        none
// ==UserScript==
// @name         Yandex 搜索结果双列显示
// @namespace    https://greasyfork.org/users/your-username
// @description  将 Yandex 搜索结果以双列方式排列,提高可读性与信息密度
// @author       你的名字或昵称
// @match        https://ya.ru/*
// @match        https://yandex.com/search/*
// @match        https://yandex.ru/search/*
// @icon         https://yandex.com/favicon.ico
// @license      MIT
// @grant        none
// ==/UserScript==
(function () {
  'use strict';

  function applyTwoColumnLayout() {
    const resultsContainer = document.querySelector('[data-zone-name="SearchResults"]');

    if (!resultsContainer) return;

    // 设置为网格布局
    resultsContainer.style.display = 'grid';
    resultsContainer.style.gridTemplateColumns = '1fr 1fr';
    resultsContainer.style.gap = '20px';
    resultsContainer.style.alignItems = 'start';

    // 每个搜索项设定统一宽度/样式
    const items = resultsContainer.querySelectorAll('li.serp-item');
    items.forEach((item) => {
      item.style.width = '100%';
      item.style.boxSizing = 'border-box';
    });
  }

  // 初次加载或动态加载内容后执行
  const observer = new MutationObserver(() => {
    applyTwoColumnLayout();
  });

  observer.observe(document.body, {
    childList: true,
    subtree: true,
  });

  // 首次执行
  applyTwoColumnLayout();
})();