Posted June 19, 2016
high rated
This add-on to GOG improves usability and adds functionality.
What it does (see attached images)
- shows game title in green with a big check mark if you own it.
- adds links to search for the game on YouTube, Steam and metacritic
It helps you avoid purchasing games that you already own and helps find more information about a game.
I find this especially helpful during sales.
You need a css/js injector for this to work e.g. https://goo.gl/SJWKyv
Below is the css and js code you need.
Enjoy!
gog.css
======
.header__title,.inj-quick-links {
display:inline-block;
}
.inj-quick-links a {
padding:0 0 0 15px;
font-size: 14px;
}
.inj-quick-links a:hover {
text-decoration:underline;
}
.owned {
color: rgb(55, 87, 1);
xborder-bottom: 1px dotted;
position:relative;
}
.owned:before {
content: " ";
display: block;
border: solid 0.4em rgba(55,87,1,0.9);
border-radius: 50%;
height: 0;
width: 0;
position: absolute;
left: -0.95em;
top: 50%;
margin-top: -0.35em;
}
.owned:after {
content: " ";
display: block;
width: 0.15em;
height: 0.35em;
border: solid rgba(255, 255, 255, 0.9);
border-width: 0 0.12em 0.12em 0;
position: absolute;
left: -0.7em;
top: 50%;
margin-top: -0.225em;
transform: rotate(45deg);
}
gog.js
=====
// wrap in function - runs when page is ready - same as calling Handler for .ready()
$(function() {
// quick toggle - replace with true to disable script
if (!true) return;
function main(){
// block execution until element is available
$element = $('.header__title');
if (!$element.length) {
setTimeout(main,500);
return;
};
// main
colorOwned($element);
var title = ' ' + $element.html().toLowerCase();
var queryHead = "https://duckduckgo.com/?q=\\";
var queryTail = "";
var youtubeURL = encodeURI(queryHead+'youtube pc gameplay'+title+queryTail);
var steamURL = encodeURI(queryHead+'steampowered'+title+queryTail);
var metacriticURL = encodeURI(queryHead+'metacritic pc game'+title+queryTail);
var youtubeHTML = '<span><a href="'+youtubeURL+'">Youtube</a></span>';
var steamHTML = '<span><a href="'+steamURL+'">Steam</a></span>';
var metacriticHTML = '<span><a href="'+metacriticURL+'">MetaCritic</a></span>';
var containerHTML = '<div class="inj-quick-links">'+youtubeHTML + steamHTML + metacriticHTML+'</div>';
$object = $('<div/>').html(containerHTML).contents();
$element.after($object);
}
function colorOwned($e){
if ($('*[ng-show="productStatus.isOwned"]').is(":visible")) {
$e.addClass('owned');
};
}
// delay exectuion to wait for page JS to finish
var delayTime = 0;
setTimeout(function(){main();}, delayTime);
});
What it does (see attached images)
- shows game title in green with a big check mark if you own it.
- adds links to search for the game on YouTube, Steam and metacritic
It helps you avoid purchasing games that you already own and helps find more information about a game.
I find this especially helpful during sales.
You need a css/js injector for this to work e.g. https://goo.gl/SJWKyv
Below is the css and js code you need.
Enjoy!
gog.css
======
.header__title,.inj-quick-links {
display:inline-block;
}
.inj-quick-links a {
padding:0 0 0 15px;
font-size: 14px;
}
.inj-quick-links a:hover {
text-decoration:underline;
}
.owned {
color: rgb(55, 87, 1);
xborder-bottom: 1px dotted;
position:relative;
}
.owned:before {
content: " ";
display: block;
border: solid 0.4em rgba(55,87,1,0.9);
border-radius: 50%;
height: 0;
width: 0;
position: absolute;
left: -0.95em;
top: 50%;
margin-top: -0.35em;
}
.owned:after {
content: " ";
display: block;
width: 0.15em;
height: 0.35em;
border: solid rgba(255, 255, 255, 0.9);
border-width: 0 0.12em 0.12em 0;
position: absolute;
left: -0.7em;
top: 50%;
margin-top: -0.225em;
transform: rotate(45deg);
}
gog.js
=====
// wrap in function - runs when page is ready - same as calling Handler for .ready()
$(function() {
// quick toggle - replace with true to disable script
if (!true) return;
function main(){
// block execution until element is available
$element = $('.header__title');
if (!$element.length) {
setTimeout(main,500);
return;
};
// main
colorOwned($element);
var title = ' ' + $element.html().toLowerCase();
var queryHead = "https://duckduckgo.com/?q=\\";
var queryTail = "";
var youtubeURL = encodeURI(queryHead+'youtube pc gameplay'+title+queryTail);
var steamURL = encodeURI(queryHead+'steampowered'+title+queryTail);
var metacriticURL = encodeURI(queryHead+'metacritic pc game'+title+queryTail);
var youtubeHTML = '<span><a href="'+youtubeURL+'">Youtube</a></span>';
var steamHTML = '<span><a href="'+steamURL+'">Steam</a></span>';
var metacriticHTML = '<span><a href="'+metacriticURL+'">MetaCritic</a></span>';
var containerHTML = '<div class="inj-quick-links">'+youtubeHTML + steamHTML + metacriticHTML+'</div>';
$object = $('<div/>').html(containerHTML).contents();
$element.after($object);
}
function colorOwned($e){
if ($('*[ng-show="productStatus.isOwned"]').is(":visible")) {
$e.addClass('owned');
};
}
// delay exectuion to wait for page JS to finish
var delayTime = 0;
setTimeout(function(){main();}, delayTime);
});