Vimperator DuckDuckGo Tile Hints

Enables Vimperator to identify DuckDuckGo tiles (e.g. image or video tiles) as something that should be hinted.

当前为 2015-02-06 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// License (WTFPL): http://www.wtfpl.net/

// ==UserScript==
// @name           Vimperator DuckDuckGo Tile Hints
// @version        0.1
// @description    Enables Vimperator to identify DuckDuckGo tiles (e.g. image or video tiles) as something that should be hinted.
// @license        WTFPL
// @namespace      https://greasyfork.org/en/users/8929-skoogit
// @include        https://duckduckgo.com/*
// @grant          none
// ==/UserScript==

// Trigger function when content is inserted into the div that wraps around all tiles
document.getElementById('zero_click_wrapper').addEventListener("DOMNodeInserted", function()
{
    // Set a dummy onclick attribute to every tile
    // This enables Vimperator to identify the tiles as something that should be hinted
    var tiles = document.getElementsByClassName('tile');
    for (i=0; i < tiles.length; i++)
        tiles[i].setAttribute('onclick', 'javascript:void();');
});