Tuesday, February 10, 2015

Bookmarklet for Navigation

Here is a quick bookmarklet to copy your Navigation to text while in Peoplesoft.  This works if your Class name for you breadcrumbs is pthnavbcanchor.

javascript:function getCref() { var x = document.getElementsByTagName('A'); var i; for (i = 0; i < x.length; i++) { var d = x[i].id; if (d.substring(0, 15) == 'pthnavbccrefanc') { return x[i].innerHTML }}}function getElementsByClassName(node, classname) { var a = []; var re = new RegExp('(^| )'+classname+'( |$)'); var els = node.getElementsByTagName('*'); for(var i=0,j=els.length; i>' +  nav[i].innerHTML;};}; var cref; cref = getCref();navPath = navPath + '>>' + cref; window.prompt('Copy to Clipboard: Ctrl+C, Enter',navPath);





To implement this Bookmarklet follow these instructions in Chrome:

Right click on your Bookmarks bar and select add page

*Note:  If you cannot see the bookmarks (ctrl+shift+B) will hide and show it in Chrome.

Edit the new book. I used GetNavPath as the name and them copy the JavaScript from the Blog to the URL.




Then test it.

From the Web Profile I get this text:

>>Favorites>>Main Menu>>PeopleTools>>Web Profile

It will show the Favorites, but I usually stop copying at Main Menu.  Then I press the Cancel button to prevent the page from redirecting in Chrome.


2 comments:

  1. Hi, I wanted to ask if bookmarklet could work from user side. I have tried to bookmark the javascripts shown in the webpage, but it wont work when I hit the bookmarklet, it only works when I click on the webpage javascript hyperlink. Plz shed some light on it.

    ReplyDelete
  2. I have added instructions on how to implement this bookmarklet for PeopleSoft. Please follow the instructions I have provided for Chrome. Thanks!

    ReplyDelete