FamilySearch Family Tree Bookmarklets: Difference between revisions

→‎Source linker: doesn't work anymore, since FS uses shadow DOM :(
(→‎Source linker: also use current person's ID)
(→‎Source linker: doesn't work anymore, since FS uses shadow DOM :()
Line 33: Line 33:
Bonus: if you are on a merge page already, it will also submit the existing merge (you have to change the text after <code>button_text=</code> to your language version of the submit button with which you finally merge people in your language version (for German it would be 'Verschmelzung abschlie%C3%9Fen')
Bonus: if you are on a merge page already, it will also submit the existing merge (you have to change the text after <code>button_text=</code> to your language version of the submit button with which you finally merge people in your language version (for German it would be 'Verschmelzung abschlie%C3%9Fen')
<code><nowiki>javascript:var kill = prompt('ID of person to be removed').trim(); var keep = window.getSelection().toString().trim(); var button_text = 'Finish Merge'; var merge_window = window.open( 'https://www.familysearch.org/tree/merge/'+keep+'/other-person/' +kill); if(window.location.toString().indexOf('merge')!=-1) { submitMergePage(); } function submitMergePage() { var inputs = document.getElementsByTagName('input'); for(var i=0;i<inputs.length;i++) { if (inputs[i].type=='submit' && inputs[i].value==button_text) { inputs[i].click(); } } }</nowiki></code>
<code><nowiki>javascript:var kill = prompt('ID of person to be removed').trim(); var keep = window.getSelection().toString().trim(); var button_text = 'Finish Merge'; var merge_window = window.open( 'https://www.familysearch.org/tree/merge/'+keep+'/other-person/' +kill); if(window.location.toString().indexOf('merge')!=-1) { submitMergePage(); } function submitMergePage() { var inputs = document.getElementsByTagName('input'); for(var i=0;i<inputs.length;i++) { if (inputs[i].type=='submit' && inputs[i].value==button_text) { inputs[i].click(); } } }</nowiki></code>
== Source linker ==
Opens all research hints each in a new window.
=== Firefox (and others?) ===
Usage:
# Open a [[#Research help|research hints page]]
# Click the bookmarklet
# All hints open in new windows
<code><nowiki>
javascript:
var urlParts = window.location.pathname.toString().split("/");
var personId = urlParts[urlParts.length-1];
var linkPrefix = 'https://www.familysearch.org/search/linker?icid=fs-attach&&id=' + personId + '&ark=';
var new_window_text ="";
var alert_text ="";
var inputs = document.getElementsByTagName('a');
for(var i=0; i<inputs.length; i++)
{
    if (inputs[i].dataset.item != null && inputs[i].dataset.item.toString().indexOf('ark')!=-1 &&  inputs[i].dataset.item.toString().indexOf('collection')==-1)
    {
        var ark = inputs[i].dataset.item.toString().replace('https://familysearch.org/', '');
        window.open(linkPrefix + ark);
    }
}
void(0);
</nowiki></code>
=== Chrome  ===
Usage:
# Open a [[#Research help|research hints page]]
# Click the bookmarklet
# Copy the URL list that appears on top of the page
# Paste it into the dialog created by the [https://chrome.google.com/webstore/detail/bulk-url-opener-extension/hgenngnjgfkdggambccohomebieocekm Bulk URL Opener Extension] or anything similiar in order to open the urls in new tabs/windows
<code><nowiki>
  javascript:
var urlParts = window.location.pathname.toString().split("/");
var personId = urlParts[urlParts.length-1];
var linkPrefix = 'https://www.familysearch.org/search/linker?icid=fs-attach&&id=' + personId + '&ark=';
var new_window_text ="";
var alert_text ="";
var inputs = document.getElementsByTagName('a');
for(var i=0;i<inputs.length;i++)
{
    if (inputs[i].dataset.item != null && inputs[i].dataset.item.toString().indexOf('ark')!=-1 &&  inputs[i].dataset.item.toString().indexOf('collection')==-1)
    {
        var ark = inputs[i].dataset.item.toString().replace('https://familysearch.org/', '');
        new_window_text+= linkPrefix + ark+"<br>";
        alert_text+= linkPrefix + ark+"\n";
    }
}
var vl_logout = document.getElementsByTagName('body')[0];
if (vl_logout)
{
    var ins_li = document.createElement('div');
    ins_li.innerHTML='<textarea>'+alert_text+'</textarea>';
    vl_logout.parentNode.insertBefore(ins_li, vl_logout);
}
;void(0);
</nowiki></code>
[[Category:FamilySearch Family Tree]]
28

edits