diff --git a/src/features/g2g/g2g.js b/src/features/g2g/g2g.js index 636664b9..ee27d3bd 100644 --- a/src/features/g2g/g2g.js +++ b/src/features/g2g/g2g.js @@ -112,8 +112,10 @@ function replacePermaLinks() { //https://www.wikitree.com/g2g/1652303/join-the-2nd-germany-research-party-on-wikitree-day?show=1657604#a1657604 const indexShow = allAnchorNodes[i].href.indexOf("show="); + const indexHash = allAnchorNodes[i].href.indexOf("#"); //spare the top left menu when show= is used + const indexLast = allAnchorNodes[i].href.length - 1; - if (indexShow > -1) { + if (indexShow > -1 && indexHash < indexLast) { //console.log(allAnchorNodes[i].href); const indexHash = allAnchorNodes[i].href.indexOf("#"); const indexAfterHashAndAorC = indexHash + 2; @@ -163,6 +165,9 @@ async function initG2G() { replacePermaLinks(); } } + if (options.fixHome) { + document.getElementsByClassName("pureCssMenui0")[0].href = "https://www.wikitree.com/wiki/Special:Home"; + } } shouldInitializeFeature("g2g").then((result) => { diff --git a/src/features/g2g/g2g_options.js b/src/features/g2g/g2g_options.js index e6cd70c2..a6c8f45b 100644 --- a/src/features/g2g/g2g_options.js +++ b/src/features/g2g/g2g_options.js @@ -76,6 +76,12 @@ const g2g = { label: "Turn WikiTree IDs into links to the profiles", defaultValue: true, }, + { + id: "fixHome", + type: OptionType.CHECKBOX, + label: "Make 'My WikiTree' link work like on other pages", + defaultValue: true, + }, { id: "previewLinks", type: OptionType.CHECKBOX,