Ikun Scripts

Wikipedia Reading Hint

ikun · 1.0.0 · Installs 0 · Today 0 · Updated 2026-09-20 13:50

Script language Simplified Chinese · Also Simplified Chinese, Indonesian, Japanese, Korean, Traditional Chinese

Sites wikipedia.org

Shows a dismissible tip bar on Wikipedia. Demo for site matching and DOM injection.

Install

Opening the URL above in Ikun Browser asks you to install. Update checks use the same URL.

Version history

Namespace https://scripts.ikunbrowser.com/demo/wiki-hint

Matches

Grants

Source

// ==UserScript==
// @name               维基百科阅读提示条
// @name:zh-Hans       维基百科阅读提示条
// @name:zh-Hant       維基百科閱讀提示條
// @name:en            Wikipedia Reading Hint
// @name:ja            Wikipedia の読みヒント
// @name:ko            위키백과 읽기 안내
// @name:id            Petunjuk Baca Wikipedia
// @namespace          https://scripts.ikunbrowser.com/demo/wiki-hint
// @version            1.0.0
// @description        在维基百科顶部显示一条可关闭的提示,演示按站点匹配与简单 DOM 注入
// @description:zh-Hans 在维基百科顶部显示一条可关闭的提示,演示按站点匹配与简单 DOM 注入
// @description:zh-Hant 在維基百科頂部顯示一條可關閉的提示,示範依站點匹配與簡單 DOM 注入
// @description:en     Shows a dismissible tip bar on Wikipedia. Demo for site matching and DOM injection.
// @description:ja     Wikipedia 上部に閉じられるヒントを表示します。サイト一致と DOM 注入のデモです。
// @description:ko     위키백과 상단에 닫을 수 있는 안내를 표시합니다. 사이트 매칭·DOM 데모입니다.
// @description:id     Menampilkan bilah tips di Wikipedia. Demo pencocokan situs dan injeksi DOM.
// @author             ikun
// @match              https://*.wikipedia.org/*
// @match              https://wikipedia.org/*
// @grant              GM_getValue
// @grant              GM_setValue
// @license            MIT
// ==/UserScript==

(function () {
  'use strict';
  var key = 'ikun-wiki-hint-dismissed';
  try {
    if (typeof GM_getValue === 'function' && GM_getValue(key, false)) return;
  } catch (e) {}

  function ready(fn) {
    if (document.body) fn();
    else document.addEventListener('DOMContentLoaded', fn, { once: true });
  }

  ready(function () {
    if (document.getElementById('ikun-demo-wiki-hint')) return;
    var bar = document.createElement('div');
    bar.id = 'ikun-demo-wiki-hint';
    bar.setAttribute(
      'style',
      'position:sticky;top:0;z-index:99999;padding:8px 12px;background:#1a5f4a;color:#fff;font:14px/1.4 system-ui,sans-serif;display:flex;gap:12px;align-items:center;justify-content:space-between;'
    );
    var msg = document.createElement('span');
    msg.textContent = '坤坤脚本示范:本条只在维基百科站点匹配。 / Ikun demo: Wikipedia-only match.';
    var btn = document.createElement('button');
    btn.type = 'button';
    btn.textContent = '关闭 / Dismiss';
    btn.setAttribute(
      'style',
      'border:0;border-radius:4px;padding:4px 10px;background:#fff;color:#1a5f4a;cursor:pointer;font:inherit;'
    );
    btn.addEventListener('click', function () {
      try {
        if (typeof GM_setValue === 'function') GM_setValue(key, true);
      } catch (e) {}
      bar.remove();
    });
    bar.appendChild(msg);
    bar.appendChild(btn);
    document.body.insertBefore(bar, document.body.firstChild);
  });
})();