Happened now
flauschke @ flauschke @feddit.de Posts 4Comments 42Joined 2 yr. ago
flauschke @ flauschke @feddit.de
Posts
4
Comments
42
Joined
2 yr. ago
I've adapted it to work on kbin - let me know if anyone finds any issues
js
// ==UserScript== // @name kbin lemmy redirect // @version 1.0 // @description Redirect kbin to your local Lemmy instance // @author @flauschke@feddit.de // @match https://*/m/* // @icon https://join-lemmy.org/static/assets/icons/favicon.svg // ==/UserScript== // best effort guess const isKbin = typeof KBIN_USER !== 'undefined' && typeof KBIN_MAGAZINE !== 'undefined'; if (isKbin) { // Get URL info const localLemmy = "feddit.de"; const splitUrl = location.href.split("/"); const instanceUrl = splitUrl[2]; const community = splitUrl[4]; const localizedUrl = "https://" + localLemmy + "/c/" + community + "@" + instanceUrl; // Create redirect button if not on local if (instanceUrl !== localLemmy) { const wrapper = document.createElement("div"); wrapper.setAttribute("style", "width: 100%;position: fixed;top: 0;") const container = document.createElement("div"); container.setAttribute("style", "position:relative;max-width: 1650px;width: 100%;margin: 0 auto;") const zNode = document.createElement("button"); zNode.innerText = "Open in local instance"; zNode.setAttribute("id", "localizeContainer"); // add styles to the button embedded zNode.setAttribute( "style", "cursor: pointer; padding: 5px; margin-top: 55px; background-color: red; border-radius: 10%; border-width: 3px; border-style: solid; z-index: 10;max-width:200px;position:absolute;top:0;right:0;" ); zNode.addEventListener("click", e => window.location.replace(localizedUrl)); container.appendChild(zNode); wrapper.appendChild(container); document.body.appendChild(wrapper); } }
I once had a user announce to me via phone that they were about to send me an email with all the details about a problem they encountered.
FYI you should be able to disallow directly pushing to the master branch and only allow merging