Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

How to add working links in GM notes.

1688938113

Edited 1689334051
I like placing custom tokens on the screen as GM map markers. The markers contain GM notes with links to handouts. For some reason the links don't work and this seems to be a problem that has not been fixed for years. To fix this issue, open your roll20 game, add a bookmark, edit the bookmark and set the URL to: (fixed version) javascript:(function(e){$('body').off('._R20CUSTOM').on('click._R20CUSTOM','a[href]',function(e){let $a=$(this);if($a.closest('.note-editable').length==1){$a.clone().appendTo('body').click().remove();}})})(); Here's a video:&nbsp;<a href="https://youtu.be/l6qBMsxsACo" rel="nofollow">https://youtu.be/l6qBMsxsACo</a> Each time you reload roll20, you need to click this special bookmark to enable the fix. Here's some answers to some questions: A) exactly what procedure you are using (where is the link placed and how is it accessed) including an example of any macro or link to test with. Create a bookmark in your browser like normal. Then edit the bookmark URL and change it to the "javascript:.." contents above. B) What you expect to happen and what is actually happening. Once the bookmarklet is enabled, you can click on links in GM Notes and they will open. C) what is that Javascript supposed to do The javascript detects when you click a link in editable notes fields and opens the link. Normally this does not work when in edit mode. and where are you making the "bookmark" and how are you accessing it. To add a bookmark in chrome, I click the browser menu and click Bookmarks, bookmark this tab. After roll20 is loaded, activate the fix by clicking the special bookmark you created.
1688950727
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Philip! Can you give more detail on: A) exactly what procedure you are using (where is the link placed and how is it accessed) including an example of any macro or link to test with. B) What you expect to happen and what is actually happening. C) what is that Javascript supposed to do, and where are you making the "bookmark" and how are you accessing it. With the information provided, it's very difficult to tell what you are trying to do and what is going wrong. Finally, in case this is related to your issue, Token GM Notes always open in edit mode. Links do not work in edit mode. The only way to access them otherwise is with a Mod Script. For example, the Supernotes Mod Script can pull token notes and send them to chat, where they can produce clickable links. There are potentially other ways to produce what it sounds like you are trying to accomplish, but without more information, it's hard to know how to help.
1688992102

Edited 1688992249
GiGs
Pro
Sheet Author
API Scripter
Please answer Keith's questions if you want help. That said, the code you listed is a bookmarklet, and whether that works or not is a browser issue, and not native to roll20. So you can't get support for that here (in theory anyway - someone who knows the issue might help out, but it's not an area of official support). IIRC the way bookmarklets 'work' changed a few years ago, and some might not work at all. Also, the classes in Roll20 have changed a lot, so if it does theoretically work, it might need updating to match the new environment.
1689339796

Edited 1689339887
Gauss
Forum Champion
Hi Phillip,&nbsp; I don't think this is a bug, while editing text in any element of Roll20 (handout, token's GM notes, Bio &amp; Info tab) you cannot click the link. This is because the window is in edit mode.&nbsp; It has always been like this and I would not expect it to operate any differently. While editing if you clicked on a link and it opened a page that would be a problem.&nbsp;&nbsp; At the point in your video where you are trying to open a link you are editing the token. That is why there is no link to click. To my knowledge there is no way to see the GM notes on a token without editing, so there is no way to linkify things in GM notes without workarounds, such as the method you provided.&nbsp;
&gt; It has always been like this and I would not expect it to operate any differently. The issue is that you can create links in GM notes, but you can never click them since GM notes are always in edit mode. It would be nice if we could create clickable links in GM notes fields without using hacks.
1689342879

Edited 1689342945
Gauss
Forum Champion
Philip C. said: &gt; It has always been like this and I would not expect it to operate any differently. The issue is that you can create links in GM notes, but you can never click them since GM notes are always in edit mode. It would be nice if we could create clickable links in GM notes fields without using hacks. I absolutely agree that GM notes should be viewable outside of editing. Alas, I am just a user, not Roll20 staff.&nbsp;My suggestion is to make a suggestion in the Suggestion Forum .&nbsp;
1689354046
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The real reason you can create links there in the first place is just that they use the same text editor. I don't know if the original designers of the interface considered that use. There are mod script ways to use the links produced, but since fields that use the text editor are not callable by macros, that's the only way (that I know of) to access the info in chat.
1689430673

Edited 1689430745
I added a post to the suggestion forum. &nbsp;Please post a reply there to let the Roll20 developers know we want this fix!
1689442697
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Philip! You might want to mention that the bookmarklet might not work in all browsers. Chrome still allows executable JS in the URL bar (and this does the job as advertised), but the last I checked, Firefox has disabled it since the premiere of Quantum.
&gt; but the last I checked, Firefox has disabled it since the premiere of Quantum I tested the bookmarklet with the latest Firefox version and it works. It looks like bookmarklets do not work on web sites that use restrictive CSP security headers which roll20 does not for now.
1689448323
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks, that is good to know this has changed. I had dropped Firefox because of this years ago.