Greasy Fork is available in English.

IMDb Moviebox Search Button

Add a button on IMDb pages to search the movie title on moviebox.ng

Από την 04/03/2025. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         IMDb Moviebox Search Button
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Add a button on IMDb pages to search the movie title on moviebox.ng
// @match        https://www.imdb.com/title/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    function addSearchButton() {
        // Find the movie title (the first h1)
        const titleElement = document.querySelector('h1');
        if (!titleElement) {
            console.log("IMDb title element not found.");
            return;
        }

        // Get the movie title text and trim spaces
        const movieTitle = titleElement.textContent.trim();

        // Create the search URL
        const searchKeyword = movieTitle.replace(/\s+/g, '+');
        const searchURL = 'https://moviebox.ng/web/searchResult?keyword=' + searchKeyword;

        // Create a new button
        const btn = document.createElement('button');
        btn.textContent = 'Search on Moviebox';

        // Style the button to match IMDb’s color scheme
        // (IMDb's signature yellow is #f5c518, black text, small radius)
        btn.style.backgroundColor = '#f5c518';
        btn.style.color = '#000';
        btn.style.border = 'none';
        btn.style.padding = '6px 12px';
        btn.style.fontSize = '14px';
        btn.style.fontWeight = 'bold';
        btn.style.borderRadius = '4px';
        btn.style.cursor = 'pointer';
        btn.style.marginBottom = '8px'; // Some space before the title
        btn.style.display = 'inline-block';

        // On click, open a new tab to the Moviebox search URL
        btn.addEventListener('click', () => {
            window.open(searchURL, '_blank');
        });

        // Insert the button ABOVE the title
        titleElement.parentNode.insertBefore(btn, titleElement);
    }

    // Wait for the DOM to be fully loaded
    window.addEventListener('load', addSearchButton);
})();