topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 4:42 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Tip: Htmlviewurl works for local files too! :)  (Read 31039 times)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #25 on: June 17, 2008, 05:30 PM »
Mouser, farr:// links presently only seem to work with showhtml, not showfile or igo. Correct?

I saved this test html code to the local file "x.html":
<a href='farr://htmlviewurl exacttimenow.com'><img src='%FARRDIR%\AliasGroups\Installed\Core_Aliases\icons\farr\core-internet_www.ico'></a><br>click the image to Internal Surf to exacttimenow.com<br><br><a href='farr://restartsearch gowebpage'>use internal command to launch FARR webpage in external browser</a>
When running it via igo, it displays (except for the image) but the links give this error popup:
"current contents are not safe for local launching."

When running it via an alias that does showfile x.html, then then source of the .html is displayed in FARR as plaintext.

edit: fixed typo
« Last Edit: June 17, 2008, 07:50 PM by Nod5 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #26 on: June 17, 2008, 05:51 PM »
nod5, it's a bug, it should allow it since it is in a local file. will fix in update for this week.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #27 on: June 17, 2008, 07:50 PM »
great!  :Thmbsup: I look forward to testing this cool feature some more.

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #28 on: June 18, 2008, 02:44 AM »
nod5, it's a bug, it should allow it since it is in a local file. will fix in update for this week.
@mouser, does a file residing on localhost is considered as safe ?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #29 on: June 18, 2008, 08:53 AM »
right now safe are:
file:// style urls
and any file contents or html contents loaded via showfile or showhtml style commands.

but i suppose i should add localhost:// and 127.0.0.1:// urls to the list of addresses considered "sage" so that local web servers can be used in the unlikely even someone is doing something strange.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #30 on: June 20, 2008, 02:33 AM »
quick question: Can FARR display the html on the fly when a searchphrase is entered (without pressing enter)? Or do I need to handle that through a plugin?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #31 on: June 20, 2008, 02:40 AM »
i am going to be adding a feature to aliases so that you can choose to launch them as soon as they match, without having to hit enter. will be soon.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #32 on: June 20, 2008, 03:01 AM »
great! But if I want this in the meantime it should be doable through a plugin right? I've just now tried getting it to run via the javascript plugin system. I think I need something like this:
Code: Javascript [Select]
  1. FARR.setStrValue("launch","htmlviewurl filename.html");
But I haven't gotten it to run just yet.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #33 on: June 20, 2008, 03:19 AM »
try:
FARR.setStrValue("launch","htmlviewurl file://FULLPATHTOFILE/filename.html");

but you need to know the full path to the file.
i will add a new variable %PLUGINDIR% soon so you can more easily refer to a file in the plugin directory.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #34 on: June 20, 2008, 04:30 AM »
Thanks, that was it.
Once we have some way to force focus back to the inputbox and get farr:// links working then I can implement the mp3 album cover displayer idea. Yay!
edit: removed code, it was buggy
« Last Edit: June 20, 2008, 04:33 AM by Nod5 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #35 on: June 20, 2008, 04:32 AM »
it's wonderful seeing more people create plugins.
and we have to always remember to thank ecaradec for his miraculous fscript javascript plugin interface which is making it possible.

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #36 on: June 20, 2008, 01:23 PM »
<a href='farr://htmlviewurl exacttimenow.com'><img src='%FARRDIR%\AliasGroups\Installed\Core_Aliases\icons\farr\core-internet_www.ico'></a><br>click the image to Internal Surf to exacttimenow.com<br><br><a href='farr://restartsearch gowebpage'>use internal command to launch FARR webpage in external browser</a>
When running it via igo, it displays (except for the image) but the links give this error popup:
"current contents are not safe for local launching."

Also having this problem.

Once we have some way to force focus back to the inputbox and get farr:// links working then I can implement the mp3 album cover displayer idea. Yay!

Also found that focus is stolen from the search box as soon as the htmlview mode is executed. Would be great if the focus would remain in the search box and perhaps pressing tab key would move focus to the html window.

A nice addition would be to be able to using the arrow and pgup/pgdn keys from the search box to control the html window similar to how the memo mode works.
« Last Edit: June 20, 2008, 05:15 PM by s.newave »

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #37 on: June 20, 2008, 07:13 PM »
s.newave, as for the arrow keys, something like that could probably be implemented through javascript in each .html file ( for example http://code.google.com/p/js-hotkeys/ and then set up/down to send tab/ctrl-tab), but if a general solution is possible to build into FARR then all the better.

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #38 on: June 20, 2008, 07:54 PM »
Nod5 thx for the link although i was actually referring to idea of controlling the html window while focus is still in the search box.

When launching most sites using igo command for example the keyboard focus is lost and subsequently does not respond to any keyboard inout. This requires using the mouse to bring focus back to either the html window or search box.  :(

Mouser, not sure how tricky it would be, but pls can you look into the option of having focus remain/return to the search box after the site has been loaded. Unlike sites like google.com it seems that most sites do not set focus to a specific control and I think moving the focus back to the search box would provide more consistent results rather than leaving it up to the site being launched. As mentioned above you can then hit the tab key to move focus to the html window.

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #39 on: June 20, 2008, 08:03 PM »
<a href='farr://htmlviewurl exacttimenow.com'><img src='%FARRDIR%\AliasGroups\Installed\Core_Aliases\icons\farr\core-internet_www.ico'></a><br>click the image to Internal Surf to exacttimenow.com<br><br><a href='farr://restartsearch gowebpage'>use internal command to launch FARR webpage in external browser</a>
When running it via igo, it displays (except for the image) but the links give this error popup:
"current contents are not safe for local launching."

Also having this problem.

Once we have some way to force focus back to the inputbox and get farr:// links working then I can implement the mp3 album cover displayer idea. Yay!

Also found that focus is stolen from the search box as soon as the htmlview mode is executed. Would be great if the focus would remain in the search box and perhaps pressing tab key would move focus to the html window.

A nice addition would be to be able to use the arrow and pgup/pgdn keys from the search box to control the html window similar to how the memo mode works.


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #40 on: June 20, 2008, 08:13 PM »
I think i'm pretty much on board and agreeing with the requests here.

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #41 on: June 21, 2008, 04:21 AM »
i am going to be adding a feature to aliases so that you can choose to launch them as soon as they match, without having to hit enter. will be soon
please make this an option, since it would be a mess for a lot of users ...
for instance, most of my alias are dosearch aliases with one or two letter...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #42 on: June 21, 2008, 10:46 AM »
please make this an option, since it would be a mess for a lot of users ...
of course, it will be an option inside each alias, to let you say that as soon as this particular alias is matched launch it.  it will not be useful for most aliases, just on rare occasions.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #43 on: July 02, 2008, 04:40 PM »
I updated my FARR html view mode test project: an album launcher. Here's a glimpse in the form of a short flash screencast:
http://nod5.dcmembers.com/farr_album_test.htm
test.jpg
I think it could be really neat when search as you type searching works! (still needed: a way to force the cursor back to the FARR inputbox).

Though I still think a native, non-html based way to display search matches as a list of images would be more powerful. Then we could select multiple match images (representing folders) and drag and drop them to some external application for example, right click them to do context menu operations on them, and so on. And that would bypass the index that my test above requires.
« Last Edit: July 02, 2008, 04:45 PM by Nod5 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #44 on: July 02, 2008, 05:04 PM »
still needed: a way to force the cursor back to the FARR inputbox.

this will be automatic in next update.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #45 on: July 03, 2008, 04:35 AM »
Good news! :Thmbsup:

A related issue is that we currently can give the html focus like so:
<BODY onload="document.getElementById('aa').focus()">
<a id=aa href=www.google.com>aa</a>
The html page elements can then be navigated with tab/ctrl+tab without clicking to activate the page. But when then tabbing to the last element on the page FARR only sometimes loops back to the first element (just like IE does) but sometimes the tab stops working. Clicking on the html page solves that problem - then tabbing works and loops around. But the next time FARR loads a page the issue can return. Save this as html and load with igo to try it:
<BODY onload="document.getElementById('aa').focus()">
<a id=aa href=www.donationcoder.com>a</a><br>
<a href=www.donationcoder.com>a</a><br>
<a href=www.donationcoder.com>a</a><br>
<a href=www.donationcoder.com>a</a><br>
<a href=www.donationcoder.com>a</a><br>
« Last Edit: July 03, 2008, 04:38 AM by Nod5 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #46 on: July 04, 2008, 12:30 AM »
interesting..

i am adding some commands into farr that aliases and plugins can call to explicitly set focus to search editor or web browser, so it will be easier to decide what you want to do.

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #47 on: July 04, 2008, 02:19 AM »
i am adding some commands into farr that aliases and plugins can call to explicitly set focus to search editor or web browser, so it will be easier to decide what you want to do.

great !

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #48 on: July 04, 2008, 02:31 AM »
done; will be in next update.

cedardoc

  • Participant
  • Joined in 2008
  • *
  • Posts: 36
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #49 on: July 04, 2008, 10:18 AM »
I have a dumb question: Is this "htmlviewurl" thing mainly for plugin developers, or is it also the average non-programmer (like me).  I tried plunking in

<a href='farr://htmlviewurl exacttimenow.com'><img src='%FARRDIR%\AliasGroups\Installed\Core_Aliases\icons\farr\core-internet_www.ico'></a><br>click the image to Internal Surf to exacttimenow.com<br><br><a href='farr://restartsearch gowebpage'>use internal command to launch FARR webpage in external browser</a>

to a test alias, but nothing happened (and obviously I don't know what the heck I'm doing).  Is there an htmlviewurl for dummies written somewhere?  I did a cursory search on this site but couldn't find anything.  I'd like to test this on a tiddlywiki file, but don't know where to start...

DP