Surfer html viewer, want to improve it

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#16 Post by don570 »

I also noticed another strange behaviour.
When surfer opens the text file
/usr/share/doc/align.txt
only one line is shown whereas seamonkey will show entire file.

-----------------------------------------------------------------

Perhaps helpsurfer could become the default htmlviewer
by first checking if the word 'javascript' appears in the first 20 lines of the file.

If it does contain javascript ---> Then quit or use 'defaultbrowser'.

I attached the file that I use to check for javascript....
____________________________________________________

Reading about javascript
https://www.w3schools.com/js/js_whereto.asp

That is old fashioned method to add javascript to html

Perhaps checking for script tag would be necessary ---> </script>

______________________________________________
Attachments
H_R_McMaster_Facts_McMaster_Leaks.zip
File to test surfer for javascript
(26.38 KiB) Downloaded 256 times

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#17 Post by BarryK »

technosaurus wrote:I love to see people working on projects like this, but netsurf-framebuffer or even the gtk version is better and smaller... and still actively developed.
The big advantage to the framebuffer version though is that puppy's man pages work in the console. I put together a patch a while back that automatically detected linux framebuffer vs X11(actually xcb) backends... it even works in wayland and any platform with SDL support. Not mention that netsurf now uses duktape for JavaScript support.

If you want something really lite, check out goingnuts Chimera patches.

Regarding the exec "feature", this can be done more securely using cgi scripts on localhost like slitaz does for a lot of their apps (things we typically use gtkdialog for)

#EDIT: added links
I am becoming very frustrated with Surfer! It is too unstable.

So, will have a look at Netsurf next.
[url]https://bkhome.org/news/[/url]

Sailor Enceladus
Posts: 1543
Joined: Mon 22 Feb 2016, 19:43

#18 Post by Sailor Enceladus »

BarryK wrote:I am becoming very frustrated with Surfer! It is too unstable.

So, will have a look at Netsurf next.
fwiw netsurf crashed on me when visiting github puppylinux in devuan ascii

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#19 Post by BarryK »

Sailor Enceladus wrote:
BarryK wrote:I am becoming very frustrated with Surfer! It is too unstable.

So, will have a look at Netsurf next.
fwiw netsurf crashed on me when visiting github puppylinux in devuan ascii
I have just compiled netsurf 3.6, in Easy 0.3.1 pre-alpha (based on Ubuntu 16.04.3 debs). Woof-CE github,

https://github.com/puppylinux-woof-CE/woof-CE

Doesn't crash, but it doesn't render properly. I have got javascript enabled.


As a local html help viewer though, netsurf is brilliant, coz it is so fast.
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#20 Post by BarryK »

technosaurus wrote:Regarding the exec "feature", this can be done more securely using cgi scripts on localhost like slitaz does for a lot of their apps (things we typically use gtkdialog for)
Yeah, but there is no way of doing it without running a local web server, is there?

Maybe it is possible to define a custom url protocol, did see something about that for firefox.
[url]https://bkhome.org/news/[/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#21 Post by technosaurus »

BarryK wrote:
technosaurus wrote:Regarding the exec "feature", this can be done more securely using cgi scripts on localhost like slitaz does for a lot of their apps (things we typically use gtkdialog for)
Yeah, but there is no way of doing it without running a local web server, is there?

Maybe it is possible to define a custom url protocol, did see something about that for firefox.
Nothing is impossible, but by the time you limit it to file://, localhost (or remotely if logged in) and the ability to encode/decode URLs, you will have recreated​ 90% of busybox's httpd with 20% of the functionality and additional code to maintain.

About a decade ago I just added additional mime type handlers​ to SeaMonkey that when clicked, would start a particular app if it ended with a specific file extension...

netsurf could use some work on its internal mime type handling, which is hard coded in C, but its fairly safe/secure. It's JavaScript interface is also relatively new and testing has shown that full support will require a refreshing layout system (libnslayout)

The gtk version of netsurf is probably more tested and suitable for puppy-like systems, but I am interested in the framebuffer version for use in kernels with a fully functioning, built-in initramfs with wayland or X provided as an extension and a gtk3 extension provided by broadwayd. Using netsurf-framebuffer and the slitaz httpd style apps with gtk3+broadwayd for things like libre office, is currently the only way I know to allow a seamless transition between X, framebuffer and wayland (and others) I really don't expect anyone​ else is interested in it... just an itch I wanted to scratch to get a fully functioning base system back to less than floppy, yet fully and seamlessly extensible regardless of the future desktop; whether it be X, Wayland or something completely different.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#22 Post by BarryK »

technosaurus wrote:I love to see people working on projects like this, but netsurf-framebuffer or even the gtk version is better and smaller... and still actively developed.
The big advantage to the framebuffer version though is that puppy's man pages work in the console. I put together a patch a while back that automatically detected linux framebuffer vs X11(actually xcb) backends... it even works in wayland and any platform with SDL support. Not mention that netsurf now uses duktape for JavaScript support.

If you want something really lite, check out goingnuts Chimera patches.

Regarding the exec "feature", this can be done more securely using cgi scripts on localhost like slitaz does for a lot of their apps (things we typically use gtkdialog for)

#EDIT: added links
I followed that "patch" link, can't see the patch there. That would be interesting. Do you have the patched source? I would like to play with that too.
[url]https://bkhome.org/news/[/url]

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#23 Post by don570 »

I saw zigbert's script
and realized that it could be used for simple help system...

Code: Select all

#!/bin/bash
# based on  ZIGBERT script

rm -f /tmp/test
cd /usr/share/doc 

for i in $(ls *.htm) 
do
  echo $i >> /tmp/test
done 

for i in $(ls *.html) 
do
  echo $i >> /tmp/test
done

for i in $(ls *.txt) 
do
  echo $i >> /tmp/test
done
# sort alphabetically
LIST=$(sort -f /tmp/test)
echo "$LIST" > /tmp/test

do_something () { exec surfer  /usr/share/doc/"$TREE" ;} ; export -f do_something
echo '
<window title="Puppy Help System">
<vbox>
   <tree headers-clickable="false" reorderable="true">
      <label>Double-click for help</label>
      <input>cat /tmp/test</input>
      <output file>/tmp/test</output>
      <variable>TREE</variable>
      <height>600</height><width>300</width>
      <action>do_something &</action>
      <action signal="button-release-event" condition="command_is_true( echo $PTR_Y )">break:</action>
      <action signal="button-release-event">save:TREE</action>
      <action signal="button-release-event">activate:BTN_SAVE</action>
   </tree>
   <button visible="false">
      <variable>BTN_SAVE</variable>
      <action>cp /tmp/test /tmp/testbackup</action>
      <action>save:TREE</action>
      <action condition="command_is_true([[ $(wc </tmp/test) != $(wc </tmp/testbackup) ]] && sed \"s/^|*//\" /tmp/testbackup > /tmp/test && echo true )">refresh:TREE</action>
   </button>
</vbox>
</window>' | gtkdialog -s 


User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#24 Post by technosaurus »

BarryK wrote: I followed that "patch" link, can't see the patch there. That would be interesting. Do you have the patched source? I would like to play with that too.
Most of my code changes do not apply to the gtk version ... only the framebuffer version
The code changes are in the inline code tags:
http://murga-linux.com/puppy/viewtopic. ... 996#697996
http://murga-linux.com/puppy/viewtopic. ... 373#698373
I find it easier to review that way and you can just cut+paste them into geany or hand edit the code ... which will probably be necessary since the netsurf code has become much more organized since 2013
There is another post related to getting the right fonts (maybe applicable to the gtk version) at:
http://murga-linux.com/puppy/viewtopic. ... 490#698490
But again, it is 4+ years old so some human interpretation may be required.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#25 Post by don570 »

I made a help system for puppy that can be used with all the common languages. There is no need to use Google translate.
I open the documents with the default browser.

http://murga-linux.com/puppy/viewtopic.php?t=111296

____________________________________________________
Attachments
screenshot-puppy_help.jpg
(41.75 KiB) Downloaded 421 times

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#26 Post by BarryK »

HelpSurfer now version 0.6, see blog post:

https://bkhome.org/news/202002/helpsurf ... ashes.html
[url]https://bkhome.org/news/[/url]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

go full webkit

#27 Post by sc0ttman »

Barry, your blog URLs are not working for me... Site seems down..


---

On another note ...

Really, we should get around to compiling a tiny, lightweight WebKit program - just a webkit viewport or "webview" in a window, no menus etc..

Like this: https://github.com/zserge/webview

Example usage: http://murga-linux.com/puppy/viewtopic. ... 37#1042737


Alternatively, UltraLight is a cut down version of WebKit, still features proper JS, HTML5, CSS3, etc: http://murga-linux.com/puppy/viewtopic.php?t=117217

Something similar, but with a kind of app framework attached: http://murga-linux.com/puppy/viewtopic.php?t=117429


...or maybe even using webkit and gtk direct in a shell script:

http://murga-linux.com/puppy/viewtopic.php?t=117212
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#28 Post by BarryK »

Thanks to jamesbond, HelpSurfer has become more stable:

https://bkhome.org/news/202002/helpsurf ... fixed.html

It is amazing what old work is out there, that I have overlooked. Sometimes I see something interesting, and write a note that must check that out, then the piece of paper gets thrown out and I forget about it. I probably did see Jamesbond's blog post back in 2015 then forgot about it.

HelpSurfer lives on!
[url]https://bkhome.org/news/[/url]

Post Reply