Search Reelgood

Context menu to execute UserScript

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name            Search Reelgood
// @namespace       http://tampermonkey.net/
// @description     Context menu to execute UserScript
// @version         0.20
// @author          [email protected]
// @include         *
// @grant           GM_openInTab
// @run-at          context-menu
// @license         GPL 2.0
// @description     allows a one click connection from any website to the Reelgood search results for that selection
// ==/UserScript==]]


(function() {
    'use strict';
    //first read any selected text
    var textSelected = "";
        textSelected = document.getSelection().toString().trim();

    //if none, read text under cursor
    if(textSelected.length<=1){
        var elements = document.querySelectorAll(':hover');
        textSelected = elements[elements.length-1].innerText.trim();
        console.log(elements.length+"  "+elements);
    }
    //convert non url safe characters
    //var urlsafe = textSelected.replace("&", "%26"); //textSelected = ";,/?:@&=+$-_.!~*'()#"
    var urlsafe = encodeURIComponent(textSelected);
    console.log("RightClickTo ---"+textSelected+"---"+ urlsafe );
    GM_openInTab("https://reelgood.com/search?q="+urlsafe, { active: true, insert: true, setParent: true });

})();