[TiddlyDesktop] how to open external links in default browser?

146 views
Skip to first unread message

Christian de la Serna

unread,
Jun 10, 2015, 1:53:03 AM6/10/15
to tiddl...@googlegroups.com
How to change the tiddlydesktop behaviour of opening external links? 

I am guessing i have to edit this portion of the main.js:

// Helper to trap wikilinks within a window
function trapLinks(doc) {
 doc
.addEventListener("click",function(event) {
 
// See if we're in an interwiki link
 
var interwikiLink = findParentWithClass(event.target,"tw-interwiki-link");
 
if(interwikiLink) {
 openWikiIfNotOpen
(interwikiLink.href);
 
event.preventDefault();
 
event.stopPropagation();
 
return false;
 
}
 
// See if we're in an external link
 
var externalLink = findParentWithClass(event.target,"tw-tiddlylink-external");
 
if(externalLink) {
 gui
.Shell.openExternal(externalLink.getAttribute("href"));
 
event.preventDefault();
 
event.stopPropagation();
 
return false;
 
}
 
return true;
 
},false);
}


I tried tinkering with it but don't know much about JavaScript to figure it out. 

Using tiddlydesktop-win-0.0.3. Is the 0.0.4 stable enough as a daily driver?

Thanks,
Christian

Jeremy Ruston

unread,
Jun 13, 2015, 11:29:46 AM6/13/15
to TiddlyWiki
Hi Chris

I am guessing i have to edit this portion of the main.js:

Yes, that's right, presumably you'd be replacing the call to gui.Shell.openExternal() with something else. What are you trying to accomplish?

Using tiddlydesktop-win-0.0.3. Is the 0.0.4 stable enough as a daily driver?

Gosh, that release note has obviously scared people off 0.0.4! Yes, absolutely, you should use the latest version. You'll notice that 0.0.4 has been out for several months now.

Best wishes

Jeremy.

 

Thanks,
Chris

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/411005ae-776e-40f5-a228-7f26cc24c05d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Christian de la Serna

unread,
Jun 13, 2015, 11:50:53 AM6/13/15
to tiddl...@googlegroups.com, jeremy...@gmail.com
Hi Jeremy,

I wanted to open the external links to open in the system default browser.

That is good news on the 0.0.4 part. I was concerned with the release notes. 

Thanks,
Christian

Jeremy Ruston

unread,
Jun 13, 2015, 11:52:41 AM6/13/15
to Christian de la Serna, TiddlyWiki
Hi Christian

I wanted to open the external links to open in the system default browser.

That is what is supposed to happen. What behaviour are you seeing? What version(s) of TiddlyWiki have you tried?

Best wishes

Jeremy.

 

That is good news on the 0.0.4 part. I was concerned with the release notes. 

Thanks,
Christian

Christian de la Serna

unread,
Jun 13, 2015, 12:28:06 PM6/13/15
to tiddl...@googlegroups.com, koyut...@gmail.com, jeremy...@gmail.com
I was using 0.0.3 and TW 5.1.8. 

Now I tried using 0.0.4 and the same tiddlywiki and it opens in the system default browser. It works perfectly now. Thanks again for your replies.

Thanks,
Christian
Reply all
Reply to author
Forward
0 new messages