Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 19 Oct 2017, 20:12
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Surfer html viewer, want to improve it
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [25 Posts]   Goto page: Previous 1, 2
Author Message
don570


Joined: 10 Mar 2010
Posts: 4715
Location: Ontario

PostPosted: Thu 10 Aug 2017, 17:23    Post subject:  

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>

______________________________________________
H_R_McMaster_Facts_McMaster_Leaks.zip
Description  File to test surfer for javascript
zip

 Download 
Filename  H_R_McMaster_Facts_McMaster_Leaks.zip 
Filesize  26.38 KB 
Downloaded  27 Time(s) 
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8282
Location: Perth, Western Australia

PostPosted: Thu 10 Aug 2017, 20:52    Post subject:  

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.

_________________
http://barryk.org/news/
Back to top
View user's profile Send private message Visit poster's website 
Sailor Enceladus

Joined: 22 Feb 2016
Posts: 1251

PostPosted: Thu 10 Aug 2017, 21:16    Post subject:  

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
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8282
Location: Perth, Western Australia

PostPosted: Fri 11 Aug 2017, 05:57    Post subject:  

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.

_________________
http://barryk.org/news/
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8282
Location: Perth, Western Australia

PostPosted: Fri 11 Aug 2017, 06:04    Post subject:  

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.

_________________
http://barryk.org/news/
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4745

PostPosted: Fri 11 Aug 2017, 18:31    Post subject:  

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.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8282
Location: Perth, Western Australia

PostPosted: Fri 11 Aug 2017, 21:51    Post subject:  

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.

_________________
http://barryk.org/news/
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 4715
Location: Ontario

PostPosted: Sat 12 Aug 2017, 11:34    Post subject:  

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

Code:

#!/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

Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4745

PostPosted: Sat 12 Aug 2017, 18:00    Post subject:  

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.php?p=697996#697996
http://murga-linux.com/puppy/viewtopic.php?p=698373#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.php?p=698490#698490
But again, it is 4+ years old so some human interpretation may be required.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 4715
Location: Ontario

PostPosted: Mon 14 Aug 2017, 12:29    Post subject:  

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

____________________________________________________
screenshot-puppy_help.jpg
 Description   
 Filesize   41.75 KB
 Viewed   68 Time(s)

screenshot-puppy_help.jpg

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [25 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1320s ][ Queries: 14 (0.0153s) ][ GZIP on ]