Jump to content

Bookmarklet to get a Site's UUID


Graham Quince

Recommended Posts

Here's Chris Smith bookmarklet to easily grab a site's UUID

From Wikipedia:

Quote

A bookmarklet is a bookmark stored in a web browser that contains JavaScript commands that add new features to the browser. Bookmarklets are unobtrusive JavaScripts stored as the URL of a bookmark in a web browser or as a hyperlink on a web page. Bookmarklets are usually JavaScript programs.

https://en.wikipedia.org/wiki/Bookmarklet#:~:text=A bookmarklet is a bookmark,Bookmarklets are usually JavaScript programs.

Whenever I need to get a site's uuid, I have to right-click on the site, choose "inspect" or "inspect element" then scroll through the developer tools to spot the uuid. 

javascript:$(".os_core:first").one("click", function(ev) {
  var i = jQuery(ev.originalEvent.target),         
      p = document.createElement('p'),         
      l, 
      r, 
      s;     
  i.is(".sites_core") || (i = i.closest(".sites_core"));     
  l = i.data('controllers').sites_core.site.uuid;     
  p.innerText = l;     
  document.body.appendChild(p);     
  if (document.body.createTextRange) {         
    r = document.body.createTextRange();         
    r.moveToElementText(p);         
    r.select();     
  } else if (window.getSelection) {         
    s = window.getSelection();         
    r = document.createRange();         
    r.selectNodeContents(p);         
    s.removeAllRanges();         
    s.addRange(r);     
  }     
  if (document.execCommand('copy')) {         
    Frog.Controller.prototype.growl('Site UUID copied to clipboard', 'FrogOS Developer Tools', 'configmanager');     
  } else {         
    window.prompt("Copy to Clipboard: Ctrl+C, Enter", l);     
  }     
  if ('remove' in Element.prototype) {         
    p.remove();     
  } else {         
    document.body.removeChild(p);     
  } 
});

 

To make:

  • Make a bookmark to a random page
  • Edit the bookmark
  • Replace the link with the code above

To use:

  • Click on the bookmarklet 
  • Click on the site- the Site's UUID will be copied to your clipboard.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...