Skip to content

Instantly share code, notes, and snippets.

@shrutis22
Created November 20, 2016 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrutis22/bb56ba8ce2e92272fd66ec881a7a6652 to your computer and use it in GitHub Desktop.
Save shrutis22/bb56ba8ce2e92272fd66ec881a7a6652 to your computer and use it in GitHub Desktop.
Script to add custom Logout link in Salesforce. This has to be installed in TamperMonkey
// ==UserScript==
// @name Custom Logout Flow for Salesforce
// @version 1.0
// @description Custom Logout Flow for Salesforce
// @author Shruti Sridharan
// @match https://*.salesforce.com/*
// @require https://code.jquery.com/jquery-latest.js
// ==/UserScript==
(function() {
'use strict';
var $actualLink = $( "a[href='/secur/logout.jsp']" );
var $parent = $actualLink.parent();
var $newLink = $( "<a/>" ).attr( "href", "/apex/logout" ).html( "Logout from Salesforce" );
$parent.append( $newLink );
$actualLink.remove();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment