Last active
February 2, 2021 14:05
-
-
Save gbutt/e62c691887887b8287b382455c0194c9 to your computer and use it in GitHub Desktop.
Creates link to new SFDC Release Notes from old Release Notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Redirect to new SFDC release notes | |
// @namespace https://gist.github.com/gbutt/e62c691887887b8287b382455c0194c9 | |
// @version 0.1 | |
// @description Injects a link to new SFDC Release Notes into the old Release Notes page | |
// @author Greg Butt | |
// @match https://releasenotes.docs.salesforce.com/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const paths = location.pathname.split('/'); | |
let newUrl = 'https://help.salesforce.com/articleView?id=release-notes.' + paths[4] + '&type=5'; | |
if (paths[2] === 'spring21') { | |
newUrl += '&release=230'; | |
} | |
else if (paths[2] === 'winter21') { | |
newUrl += '&release=228'; | |
} | |
else if (paths[2] === 'summer20') { | |
newUrl += '&release=226'; | |
} | |
const linkBlock = document.createElement('div'); | |
linkBlock.innerHTML = `<a href="${newUrl}">New Help Article</a>`; | |
document.querySelector('#sfdc-topic').prepend(linkBlock); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment