Skip to content

Commit

Permalink
changes to cleanupUrl function
Browse files Browse the repository at this point in the history
  • Loading branch information
Astisme committed Dec 31, 2024
1 parent 6993aa6 commit dddfaf6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions salesforce/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function setStorage(tabs) {
sendMessage({ what: "set", tabs }, afterSet);
}

function cleanupUrl(url = href, nochange = null) {
function cleanupUrl(url, nochange = null) {
const asis = nochange == null ? url.startsWith("http") : nochange;
if (url.startsWith("/lightning") || url.startsWith("/_ui/common")) { // normalized setup pages won't get here
return `${baseUrl}${url}`;
Expand Down Expand Up @@ -183,7 +183,7 @@ function toggleFavouriteButton(button, isSaved) {
}

function actionFavourite(parent) {
const url = cleanupUrl();
const url = cleanupUrl(href);
if (isCurrentlyOnSavedTab) {
const filteredTabs = currentTabs.filter((tabdef) => {
return tabdef.url !== url;
Expand All @@ -206,7 +206,7 @@ function showFavouriteButton(count = 0) {

// Do not add favourite button on Home and Object Manager
const standardTabs = ["SetupOneHome/home", "ObjectManager/home"];
if (standardTabs.includes(cleanupUrl())) {
if (standardTabs.includes(cleanupUrl(href))) {
return;
}

Expand Down Expand Up @@ -257,7 +257,7 @@ function isOnSavedTab(isFromHrefUpdate = false) {
return;
}
fromHrefUpdate = isFromHrefUpdate;
const loc = cleanupUrl();
const loc = cleanupUrl(href);
wasOnSavedTab = isCurrentlyOnSavedTab;
isCurrentlyOnSavedTab = currentTabs.some((tabdef) =>
tabdef.url.includes(loc)
Expand Down

0 comments on commit dddfaf6

Please sign in to comment.