Show io9 articles only

Filters Gizmodo/latest to just io9 articles

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Show io9 articles only
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Filters Gizmodo/latest to just io9 articles
// @author       You
// @match        https://gizmodo.com/latest
// @match        https://gizmodo.com/latest*
// @icon         https://www.google.com/s2/favicons?domain=gizmodo.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

     //boilerplate greasemonkey to wait until jQuery is defined...
  function GM_wait() {
    if(typeof window.jQuery == 'undefined') {
      window.setTimeout(GM_wait, 100);
    }
    else {
        var $ = window.jQuery;

        var io9Articles = $('article').has('a[data-ga*="Front page click"]').has('a[href*="/io9/"]');
        //io9Articles.css('background','red');
        $('article').has('a[data-ga*="Front page click"]').not(io9Articles).css('display','none');
    }
  }
  GM_wait();

    var url = document.location.toString();

    document.querySelector('html').addEventListener('DOMNodeInserted', function(ev){
        var new_url = document.location.toString();
        if (url == new_url) return; // already checked or processed
        url = new_url;

        GM_wait(); // run when URL changes
    });
})();