Json.cn-clean

json.cn 广告屏蔽

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Json.cn-clean
// @namespace    http://tampermonkey.net/
// @version      0.1.0
// @description  json.cn 广告屏蔽
// @author       半块苹果
// @match        https://www.json.cn/**
// @grant        none
// @license MIT
// ==/UserScript==

window.onload = function () {
  // 全屏
  const bodyElement = document.querySelector('body');
  bodyElement.classList.add('format-fullscreen');

  // 添加 placeholder
  var j = document.getElementById('json-src');
  var alt = '在这里输入 json 数据';
  if (j) {
    j.setAttribute('placeholder', alt);
  }

  // 移除广告和弹窗
  var topLinkArea = document.getElementsByClassName('top-link-area');
  var dialog = document.getElementsByClassName('modal-dialog');
  if (topLinkArea) {
    topLinkArea[0].parentNode.removeChild(topLinkArea[0]);
  }
  if (dialog) {
    dialog[0].parentNode.removeChild(dialog[0]);
  }
};