Reintegrated the Nav Bar Wallet Link on Blogs for PeakD.com!

avatar
(Edited)

image.png

In the course of web application development most times each subsequent release improves upon the previous one, releasing new and exciting features to draw in and retain users both new and old. As a web developer myself (albeit a shit one) it's quite easy to understand the train of thought behind most changes done to websites in the name of progress. Unless you've been living under a rock you likely noticed some pretty neat changes happening around the PeakD.com lately..

However one change to the GUI of the site sort of fucked me right off, and this was the removal of the easy to access 1 click link to get to a users wallet from their blog page. The wallet link on peoples blogs are now buried under a drop down menu and the amount of clicks required to check out someones HIVE wallet has increased 100%.. Up from 1 click access to now 2 clicks to navigate to a users wallet from their blog page.

image.png

Now admittedly this probably doesn't bother people as badly as it bugs me. However given that I'm always checking out the HIVE folk wallets to see what their stacking I found that this new "hidden" wallet link was simply put a pain in the ass. Had briefly spoken to the PeakD.com developers raising my concern however was for lack of a better term told that my personal preference of a 1 click wallet navigation from blog pages wasn't really a priority nor was it likely to be reverted back or given an option to display as it once was... Soooooo I decided to hack together a Greasemonkey/Tampermonkey script in order to revert it back to how it was.

The Code & Installation

Below is the script that re-enables the 1 click wallet navigation link on the nav bar of peoples blogs. In order to use this script you must have the Greasemonkey/Tampermonkey browser extension (or equivalent) with the preffered browser application being Google Chrome. The script has not been tested on other browsers so it's difficult to say for sure if other browsers will play nicely with the script. Now assuming you have Greasemonkey installed on your browser, feel free to create a new script and copy the code below in order to enable 1 click wallet navigation on PeakD.com. It's not a terribly complicated script, albeit it hacky af.

image.png

// ==UserScript==
// @name           PeakD.com Wallet Link Injector
// @namespace      KLYE
// @description    Re-implements the wallet link at the top of PeakD.com blogs
// @include        *://peakd.com/*
// @include        *://www.peakd.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// Visit my blog at https://peakd.com/@klye
// ==/UserScript==

console.log("PeakD.com Wallet Link Injector Start. By @KLYE");

var pathname = window.location.href;

var userWalletLink = pathname.substring(
    pathname.lastIndexOf("/") + 1
);

function injector() {
    var myDiv = document.createElement("div");
    myDiv.innerHTML = '<a id="injectedwalletlink" style="position: absolute;float: right;font-size: inherit;color: white;margin-top: -2.55em;right: 18em;" onload="injector();" href="https://PeakD.com/' + userWalletLink + '/transfers">Wallet</a>';
    $(".navbar-collapse").after(myDiv).fadeIn();
}

window.addEventListener('load', function() {
    $(document).ready(function(){
        injector();
    });
}, false);

var loadCheck = document.getElementsByClassName("loading-default");
var loadAlive = function() {
        if(loadCheck){
            console.log("loadAlive passed!");
        injector();
    } else {
         console.log("loadAlive FAILED!");
        injector();
    }
}

var linkCheck = function() {
    injector();
var linkAlive = document.getElementById("injectedwalletlink");
    if(linkAlive){
        console.log("Wallet Link is Present!");
    } else {
        console.log("Wallet Link Injection Failed!");
        injector();
    }
}

$(".navbar-collapse").ready(function() {
loadAlive();
linkCheck();
});

function showFoo() {
    injector();
}

document.onclick = showFoo;

Simply copy the code above into a fresh Greasemonkey/Tampermonkey script and hit ctrl + S to save it and you should be god to go! This script could likely be further refined and optimized however for the time being as a proof of concept and small code utility it serves its purpose without causing much if any strain on the browser.

As far as testing goes of this script it is a barely tested alpha version and should be treated as such. It may contain bugs, harbour poor cross browser compatibility or just straight up get broken in future PeakD.com releases so keep that in mind. Hopefully other folks find this code snippet useful in their quest to spy on everyone's HIVE wallets without having to waste time clicking and navigating drop down menus.

Feel free to modify the code and distribute it as you see fit. If you like this utility please consider tossing me a witness vote. Currently ranked at #56 and producing 10 or 11 HIVE blocks a day.

If you've got an idea that you'd like to have coded please feel free to get ahold of me on here or in the KLYE discord server. Rates for software development are very affordable and I'd love to get some coding work on the side going in order to supplement my income. Contact me for a development consultation today!

Thanks for reading, upvoting and interacting! Cheers!


image.png

Vote KLYE for Witness, Every Single Vote Helps, Thanks for the Support!

Need to get in Contact with KLYE?
Join the Official #KLYE Discord Server Today!


image.png
Looking for an Affordable, Secure & Reliable Server Host for Your Witness Server or Other Web Related Projects? Check out Privex.io!



2 comments
avatar

Good, I am not the only one bothered by that change.

0
0
0.000
avatar

Yeah.. I like to snoop at how much HIVE people have.. they have made it more difficult so I built this.

0
0
0.000