bing_rel_next_prev

On *.bing.com add a rel="prev" and rel="next" attribute to the <a> going to Prev and Next pages, so it works with Saka keys and others.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         bing_rel_next_prev
// @namespace    https://github.com/grepsuzette/bing_rel_next_prev
// @description  On *.bing.com add a rel="prev" and rel="next" attribute to the <a> going to Prev and Next pages, so it works with Saka keys and others. 
// @version      20191004_0007
// @author       grepsuzette
// @run-at       document-start
// @include      http*://*.bing.com/*
// @exclude      
// ==/UserScript==

(function() {
    'use strict';

    var tries = 0;
    var intv = setInterval(function() {
        var next = document.body.querySelector('a[href][title="Next page"]');
        var prev = document.body.querySelector('a[href][title="Previous page"]');
        if ( next !== null || prev !== null) {
            clearInterval(intv);    // ready, stop trying
            if (prev != null) prev.rel = "prev";
            if (next != null) next.rel = "next";
            // console.log("standardize with <a rel='prev'> and <a ref='next'>: done");
        }
        if (tries++ > 25) {
            clearInterval(intv); // stop trying after a reasonable 5sec
            // console.log("standardize with <a rel='prev'> and <a ref='next'>: abandoned, couldn't find these elements after 5 sec");
        }
    }, 230);
})();