Aurena landing page bookmarklet

  • 11 May 2021
  • 7 replies
  • 591 views

Userlevel 7
Badge +30

Sometimes you may want to create a new tab in Aurena, either for opening another page than the one you are on, to test something in B2B (if you are in "main", or the other way around), or to open IEE in the same environment. This little hack will save you from some boring copy+paste work in all these scenarios.

We will use something called a "bookmarklet" here. It's a normal web browser bookmark, although it's not very normal at all... We're basically going to execute a small piece of JavaScript code when the bookmark is clicked. If this sounds crazy, it is, but it has been standard functionality on the web for 20 years or so.

First, let's create a new bookmark. I suggest to keep it in the bookmark bar in Chrome. If it's not enabled you can enabled it by pressing Ctrl+Shift+BE. If you don't use Chrome, you'll have to figure out the steps for your browser.

1. Right click the bookmark bar, then click Add page…


2. In the dialog that opens, type "Landing page" (or whatever you like) in the Name field.
3. Paste the following in the URL field, exactly as it is (I know, it looks strange):

javascript:window.open(document.location.href.match(new RegExp ("(https://[^/]+/)(main|b2b)/ifsapplications"))[1],"_blank")

Double check the above. Copy it, don't try to type it in. It should start with "javascript:" and end with ")".

4. Click Save to save the bookmark. Your new bookmarklet is now ready to be used.

5. Now open some Aurena page other than the landing page (it's important!)

6. Click your new bookmarklet. A new tab should be opened, showing the landing page where you can chose to open another copy of Aurena (main or B2B) or open IEE.

Cool eh? We can use the same approach for many different things in Aurena. For example, if you are switching between many different environments but are mostly opening the same pages in those environments, you could create a bookmarklet for opening such a page regardless of which environment you are in (no need to keep one bookmark per environment). If there's enough interest I could post an example of such a bookmarklet as well.

The bookmarklet should work on Apps 10 as well as IFS Cloud and on Apps 10 hopefully with and without a port number in the URL.

For now, happy hacking!
 


7 replies

Userlevel 7
Badge +30

In case it was not clear: this ONE bookmarklet will work for all the Aurena installations you want to use it on. No need to keep one per installation.

 

Userlevel 5
Badge +13

Hi Mathias,

Thanks for the post, really helpful. Yes, I’m quite interested in the other bookmarklet to open a page in different environments.

Regards,

Pilar

Userlevel 7
Badge +20

This is really great @Mathias Dahl 

I already used it and works great! it can be improved more using chrome  extension shortkeys https://chrome.google.com/webstore/detail/shortkeys-custom-keyboard/logpjaacgmcbpdkdchjiaagddngobkck

  • Add this extension to chrome and go to the options.
  • create a shortcut (eg: ctrl+i) and choose the behavior as Run javaScript
  • paste the javascript code.

 

Now you can use the shortcut key to open the landing page without clicking the bookmark :sunglasses:

 

Cheers!

Damith

Userlevel 7
Badge +30

Thanks for the post, really helpful. Yes, I’m quite interested in the other bookmarklet to open a page in different environments.

Hi Pilar,

I’ll post an update on this when I get some time.

Did you try out the hack, and did it work?

/Mathias

 

Userlevel 7
Badge +30

I already used it and works great!

 

Hi Damith, that’s great to hear! :)

 

it can be improved more using chrome  extension shortkeys https://chrome.google.com/webstore/detail/shortkeys-custom-keyboard/logpjaacgmcbpdkdchjiaagddngobkck

  • Add this extension to chrome and go to the options.
  • create a shortcut (eg: ctrl+i) and choose the behavior as Run javaScript
  • paste the javascript code.

Now you can use the shortcut key to open the landing page without clicking the bookmark :sunglasses:

 

Ah, nice! Love keyboard shortcuts, have not tried that extension out. I will check it out for sure.

Thanks for the tip!

/Mathias

 

Userlevel 7
Badge +30

@dsj 

Here is a bookmarklet to open the Upload Document assistant, which will work in any environment you are currently logged into:

javascript:document.location.href=(document.location.href.match(new RegExp ("(https://[^/]+/)(main|b2b)/ifsapplications"))[1])+"main/ifsapplications/web/assistant/CreateDocuments/UploadDocuments"

In the above example the assistant does not open in a new tab. But this one does:

javascript:window.open(document.location.href.match(new RegExp ("(https://[^/]+/)(main|b2b)/ifsapplications"))[1]+"main/ifsapplications/web/assistant/CreateDocuments/UploadDocuments","_blank")

In both examples, change web/assistant/CreateDocuments/UploadDocuments to suit your needs (just copy from the web browser’s address field when you have the page you want open). For normal pages, it should say “page” instead of “assistant”.

Enjoy!

 

Userlevel 7
Badge +30

Here is another version of the first bookmarklet that shows a message to the user if it is not used in Aurena:

javascript:match=document.location.href.match(new RegExp ("(https://[^/]+/)(main|b2b)/ifsapplications"));if(match){window.open(match[1],"_blank")}else{alert("This bookmarklet can only be used from inside Aurena")}

I hope we will now see an endless stream of clever bookmarklets posted here… :-)

Happy hacking!

 

 

Reply