Sometimes you need to search for something online fairly quickly, so here’s a quick snippet of code you can throw into the document inspector to add a link to something like searching the trailer on youtube or on your favourite torrent site legal subscription streaming service.

Download the archive, it works with the items you’re seeing by pressing Ctrl+U (Cmd+U on MacOS)

💾

IMDb Outlink Button Chrome Extension

imdb-outlink.zip (35 KB)

The code is fairly simple and consists of injecting jQuery 3.5.0 and then running this in a function, which is triggered manually by pressing the keystroke mentioned above:

1
2
3
4
5
6
7
	jQuery('.lister-item-header a').each(function(){
		$title = jQuery(this).html().replace(" ", "+");
		// $url = 'https://filelist.io/browse.php?search='+$title+'&cat=0&searchin=1&sort=2';
		$url = 'https://www.youtube.com/results?search_query='+$title+'+trailer';
		$newlink = '<a target="_blank" style="color:#900" class="imdb-outlink" href="'+$url+'"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="ipc-icon ipc-icon--play-circle-outline ipc-lockup-overlay__icon" viewBox="0 0 24 24" fill="currentColor" role="presentation"><path d="M10.8 15.9l4.67-3.5c.27-.2.27-.6 0-.8L10.8 8.1a.5.5 0 0 0-.8.4v7c0 .41.47.65.8.4zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"></path></svg></a>';
		jQuery(this).parent().append($newlink);
	})

Output:

Changelog

Version 0.1.12024-06-26 — IMDb changed their Watchlist design, so the new function needs to hook onto different elements. Also making filelist default search engine because lol.

1
2
3
4
5
6
7
8
	jQuery('.ipc-title-link-wrapper').each(function(){
		$title = jQuery(this).attr("href").split("/");
		$imdbid = $title[2];
		$url = 'https://filelist.io/browse.php?search='+$imdbid+'&cat=0&searchin=3&sort=2';
		// $url = 'https://www.youtube.com/results?search_query='+$title+'+trailer';
		$newlink = '<a target="_blank" style="color:#900" class="imdb-outlink" href="'+$url+'"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="ipc-icon ipc-icon--play-circle-outline ipc-lockup-overlay__icon" viewBox="0 0 24 24" fill="currentColor" role="presentation"><path d="M10.8 15.9l4.67-3.5c.27-.2.27-.6 0-.8L10.8 8.1a.5.5 0 0 0-.8.4v7c0 .41.47.65.8.4zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"></path></svg></a>';
		jQuery(this).parent().append($newlink);
	});

And that’s it! :)