Re: [dev] [surf][stylesheet][startpage] New ownership of Startpage not reflected in description

2024-03-30 Thread NRK
On Fri, Mar 29, 2024 at 05:00:29PM +, dev@1reverse.engineer wrote:
> The description under suckless/surf/stylesheets/startpage tells the
> user, that startpage is "hiding your identity [...]", yet after
> Startpage's change of ownership, users might receive a false sense of
> privacy as outlined in this article:
> https://restoreprivacy.com/startpage-system1-privacy-one-group/
> Therefore, a removal of such passage is recommended.

The git repo of the suckless website is publicly writeable. Feel free to
push your changes in there directly: https://suckless.org/wiki/

- NRK



[dev] [surf][stylesheet][startpage] New ownership of Startpage not reflected in description

2024-03-29 Thread dev
The description under suckless/surf/stylesheets/startpage tells the user, that 
startpage is "hiding your identity [...]", yet after Startpage's change of 
ownership, users might receive a false sense of privacy as outlined in this 
article: https://restoreprivacy.com/startpage-system1-privacy-one-group/ 
Therefore, a removal of such passage is recommended.



Re: [dev] surf: usage does not match supported flags

2023-11-18 Thread Quentin Rameau
Hi Eric,

> Since at least commit fce76429b8f8ed48116557df3a478bc435145d94, the
> flags in surf's usage don't match what's actually supported.

Fixed, thanks!



Re: [dev] surf: usage does not match supported flags

2023-11-10 Thread Hiltjo Posthuma
On Fri, Nov 10, 2023 at 10:37:31AM -0800, Eric Pruitt wrote:
> Since at least commit fce76429b8f8ed48116557df3a478bc435145d94, the
> flags in surf's usage don't match what's actually supported.
> 
> Eric
> 

This is the -p and -P option.
It should probably also be removed from the man page :)

-- 
Kind regards,
Hiltjo



[dev] surf: usage does not match supported flags

2023-11-10 Thread Eric Pruitt
Since at least commit fce76429b8f8ed48116557df3a478bc435145d94, the
flags in surf's usage don't match what's actually supported.

Eric



Re: [dev] surf/webkit2gtk-2.38.0 file descriptors

2022-10-21 Thread Petr Vaněk
Hi,

On Sun, Oct 16, 2022 at 05:48:44PM +0200, Quentin Rameau wrote:
> I've hacked some solution to the problem of passing the socket pair
> to the web-extension.
> 
> It is pushed to git but not released yet,
> please test it and report if it works or if you get any issue with it.

I have tested it with both webkit-2.{36.8,38.0} but it segfaults with
following message

** (WebKitWebProcess:30255): CRITICAL **: 15:56:37.467: const char* 
webkit_user_message_get_name(WebKitUserMessage*): assertion 
'WEBKIT_IS_USER_MESSAGE(message)' failed

which is printed from webext-surf.so, however it is most probably
because of dying surf. The webkit_web_page_send_message_to_view_finish
function in pageusermessagereply returns NULL with an error message:
"Operation was cancelled", the following function
webkit_user_message_get_name fails because it does not expect NULL.

The segfault happens here:

   r = webkit_user_message_new_with_fd_list("surf-pipe", NULL, gfd);

because invalid gfd, which contains weird values like: 0xc376b480.

This is related to error messages from gcc-11.3.0:

surf.c: In function 'viewusrmsgrcv':
surf.c:1594:15: warning: implicit declaration of function 
'g_unix_fd_list_new_from_array' [-Wimplicit-function-declaration]
 1594 | gfd = g_unix_fd_list_new_from_array([1], 1);
  |   ^
surf.c:1594:13: warning: assignment to 'GUnixFDList *' {aka 'struct 
_GUnixFDList *'} from 'int' makes pointer from integer without a cast 
[-Wint-conversion]
 1594 | gfd = g_unix_fd_list_new_from_array([1], 1);
  | ^

because of missing gio/gunixfdlist.h includes. I will send fix commit
soon to hackers mailing list.

Petr



[dev] surf/webkit2gtk-2.38.0 file descriptors

2022-10-16 Thread Quentin Rameau
Hi,

Sorry for not answering directly,
but as there has been several threads about it,
I'm making a global answer here.

I've hacked some solution to the problem of passing the socket pair
to the web-extension.

It is pushed to git but not released yet,
please test it and report if it works or if you get any issue with it.

Cheers!

P.S.: I know there are several others pending patches but I don't have
a lot of free time those days.
I promise I'm interested in merging them but I don't hesitate to "bump"
them again so that I can trace those still relevant.



Re: [dev][surf] surf has become super-slow!

2022-10-13 Thread Andy Gozas

On 2022-10-12 05:00 PM, Robert Winkler wrote:

Hi, I just re-compiled surf on a recent manjaro arch linux;
However, text input has become too slow for productive use.
Is the problem known? Any idea on how to solve it?


Hi, you should check your webkit2gtk version if it was installed using 
the package manager (for archlinux: pacman -Qi webkit2gtk).
On webkit2gtk versions above 2.36.6 there is a bug which causes all 
kinds of problems in surf 
(http://lists.suckless.org/dev/2210/34979.html).
If you are on the affected versions, you should try and either remove 
the webkit library as described in the thread above, or downgrade to a 
previous version of webkit2gtk, which you can find here (for archlinux): 
https://archive.archlinux.org/packages/w/webkit2gtk/ and see if your 
problem would go away.


---
Andy Gozas.



[dev][surf] surf has become super-slow!

2022-10-12 Thread Robert Winkler
Hi, I just re-compiled surf on a recent manjaro arch linux;
However, text input has become too slow for productive use.
Is the problem known? Any idea on how to solve it?



Re: [dev] [surf] Application renders unresponsive after first keystrokes

2022-10-09 Thread Andy Gozas

On 2022-10-09 04:40 PM, Petr Vaněk wrote:

Hi,

On Sun, Oct 09, 2022 at 06:12:56PM +0200, Chris Weber wrote:
Surf is my browser for 6 month (/wo any issue ) and last week the 
above

issue arose.
When I navigate to any website (js heavy or html only) and begin to
interact with the website via keyboard, the website content renders
unresponsive from 5-20s. After rendering responsive again, it will
steadily happen again and again.
I assume it's an updated dependency which I installed unintentionally,
because I left the surf sources untouched.

Do you have any tips for troubleshooting the above issue?
My first attempt was to debug with gdb, but I'm unshure where to put 
the

breakpoints.
I think it should be easier to profile it first and spot the component
which freezes the rendering.
Or install different versions of webkit?


I experience the same issue with webkit-gtk 2.36.8 and 2.38.0. I 
switched

back to 2.36.7, which works fine. I didn't find any related bug report
in upstream (one week ago).

It would be probably nice to git-bisect between 2.36.7 and 2.36.8 to
find the commit causing this issue.

Best,
Petr


If I had to guess, this is probably related to this problem in Webkit 
https://github.com/WebKit/WebKit/pull/4868


Since the last Webkit update (commit 28a89facb8720 in Webkit), file 
descriptors from the main process are no longer passed to child 
processes, which results in surfs web-extension reading out data out of 
a different file descriptor, that Webkit is using for its own 
communication, which results in the whole program glitching out.


From what I understand, the change will be reverted in the next release 
of Webkit. Until then, you would have to either downgrade Webkit to 
2.36.7 or remove the web extension file located in /usr/local/lib/surf/ 
directory. I still think however, that this behavior of surf should be 
changed, since it was made clear to me that there is no guarantee that 
FDs will always be passed going forward.


One way of communication that I found and was also suggested to me by 
Webkit contributors is using function 
webkit_web_context_send_message_to_all_extensions which is part of 
Webkit API, so it would not break as easily.


---
Andy Gozas.



Re: [dev] [surf] Application renders unresponsive after first keystrokes

2022-10-09 Thread Petr Vaněk
Hi,

On Sun, Oct 09, 2022 at 06:12:56PM +0200, Chris Weber wrote:
> Surf is my browser for 6 month (/wo any issue ) and last week the above
> issue arose.
> When I navigate to any website (js heavy or html only) and begin to
> interact with the website via keyboard, the website content renders
> unresponsive from 5-20s. After rendering responsive again, it will
> steadily happen again and again.
> I assume it's an updated dependency which I installed unintentionally,
> because I left the surf sources untouched.
> 
> Do you have any tips for troubleshooting the above issue?
> My first attempt was to debug with gdb, but I'm unshure where to put the
> breakpoints.
> I think it should be easier to profile it first and spot the component
> which freezes the rendering.
> Or install different versions of webkit?

I experience the same issue with webkit-gtk 2.36.8 and 2.38.0. I switched
back to 2.36.7, which works fine. I didn't find any related bug report
in upstream (one week ago).

It would be probably nice to git-bisect between 2.36.7 and 2.36.8 to
find the commit causing this issue.

Best,
Petr



[dev] [surf] Application renders unresponsive after first keystrokes

2022-10-09 Thread Chris Weber

Hi all,

Surf is my browser for 6 month (/wo any issue ) and last week the above
issue arose.
When I navigate to any website (js heavy or html only) and begin to
interact with the website via keyboard, the website content renders
unresponsive from 5-20s. After rendering responsive again, it will
steadily happen again and again.
I assume it's an updated dependency which I installed unintentionally,
because I left the surf sources untouched.

Do you have any tips for troubleshooting the above issue?
My first attempt was to debug with gdb, but I'm unshure where to put the
breakpoints.
I think it should be easier to profile it first and spot the component
which freezes the rendering.
Or install different versions of webkit?
I'm happy for any pointers :)

I hope it's okay to ask a question like this here, I don't want misuse
the mailer as suckless support hotline :D

Best and thanks,
Chris




Re: [dev] [surf] Ctrl-Y doesn't copy url to clipboard

2022-08-03 Thread Greg Reagle
On Wed, Aug 3, 2022, at 8:43 AM, Chris Weber wrote:
> When I start a blank installation of surf and try to copy any url into
> my clipboard via ctrl-y (as stated in the man pages), it won't copy
> anything at all. Is the man page outdated? Am I doing anything wrong? Do
> I need to install some userscripts for this?

"Ctrl-y Copies current URI to primary selection." according to my man page.

Are you using X11?  If yes, I highly recommend that you learn the difference 
between "PRIMARY and "CLIPBOARD" selections [1], and learn how to use PRIMARY.  
Being able to copy and paste with the mouse without the keyboard is one of the 
joys of my using Linux rather than MS Windows.  I don't use Wayland and don't 
know how it works.

[1] https://freedesktop.org/wiki/Specifications/ClipboardsWiki/



Re: [dev] [surf] Ctrl-Y doesn't copy url to clipboard

2022-08-03 Thread Mateusz Okulus
> When I start a blank installation of surf and try to copy any url into
> my clipboard via ctrl-y (as stated in the man pages), it won't copy
> anything at all. Is the man page outdated? Am I doing anything wrong? Do
> I need to install some userscripts for this?

Ctrl-y copies url into primary selection, which is different from
clipboard. I've attached a patch that changes this to use clipboard, if
you'd prefer that.

There is also a program called autocutsel, which allows synchronization
between primary selection and clipboard.

You'd add something like this to .xinitrc:
autocutsel -selection CLIPBOARD -fork
autocutsel -selection PRIMARY -fork

Which will essentially merge clipboard and primary selection. This will
be a global change, which might not be what you want.

Regards,
mmokulus
diff --git a/surf.c b/surf.c
index 474c01b..c442fa7 100644
--- a/surf.c
+++ b/surf.c
@@ -1845,11 +1845,11 @@ clipboard(Client *c, const Arg *a)
 {
if (a->i) { /* load clipboard uri */
gtk_clipboard_request_text(gtk_clipboard_get(
-  GDK_SELECTION_PRIMARY),
+  GDK_SELECTION_CLIPBOARD),
   pasteuri, c);
} else { /* copy uri */
gtk_clipboard_set_text(gtk_clipboard_get(
-  GDK_SELECTION_PRIMARY), c->targeturi
+  GDK_SELECTION_CLIPBOARD), c->targeturi
   ? c->targeturi : geturi(c), -1);
}
 }


[dev] [surf] Ctrl-Y doesn't copy url to clipboard

2022-08-03 Thread Chris Weber

Hi all,

thanks for the great tool.

When I start a blank installation of surf and try to copy any url into
my clipboard via ctrl-y (as stated in the man pages), it won't copy
anything at all. Is the man page outdated? Am I doing anything wrong? Do
I need to install some userscripts for this?

I'm on ubuntu 21.04 and running the latest prebuild binaries of surf
from the homepage.

Thanks, Chris



Re: [dev] [surf] webkit

2022-07-10 Thread Markus Wichmann
On Sun, Jul 10, 2022 at 08:20:04AM +0200, Roberto E. Vargas Caballero wrote:
> I use surf in this way too. It works but it has problems with some pages.
> It is hard to kow the patches that you distribution adds to the upstream
> project.
>
>

Solvable problem:

$ apt-get source webkitgtk
$ cd webkitgtk-*
$ ls debian/patches

In my case, seems to mostly improve support for rarely used
architectures (Sparc, ARM 32, i386 without SSE support,...).

Ciao,
Markus



Re: [dev] [surf] webkit

2022-07-10 Thread Roberto E. Vargas Caballero
Hi,

On Sat, Jul 09, 2022 at 11:39:37AM -0300, Renato Andrade Galvão wrote:
> So I have used surf, which I compile from your suckless repositories,
> along with the webkit lib package from debian. Currently I can't do
> anything better than this.

I use surf in this way too. It works but it has problems with some pages.
It is hard to kow the patches that you distribution adds to the upstream
project.


Roberto Vargas.



[dev] [surf] webkit

2022-07-09 Thread Renato Andrade Galvão
Hi, suckless guys!

It is warned in the surf suckless page: "Compile your own webkit or
expect hell.".

I can't compile webkit for this is a huge task for my 9 years old laptop.

So I have used surf, which I compile from your suckless repositories,
along with the webkit lib package from debian. Currently I can't do
anything better than this.

Renato



Re: [dev][surf] Is there any suckless webkit?

2022-05-02 Thread LM
On Mon, May 2, 2022 at 3:44 PM Robert Winkler
 wrote:
>
> Maybe I am a bit naiv, or technically not informed enough,
> BUT:
>
> Is there any webkit/browser that:
> - Does not consume most of the computer resources (!!!).
> - Is compatible with Java script.
> - Displays modern websites without getting stalled?
>
> Ideally there would be a vim-style keybinding available, and, of course,
> it should be OS/ hackable.

I wish.  I think when you put "webkit" based browser in the mix you'll
have issues with finding something that doesn't consume a lot of
computer resources.  surf is the first webkit browser that comes to
mind for what you're looking for.  I'm guessing you've already looked
at that?

Since you mentioned the text browsers and netsurf, I'll add links and
dillo/D+ to that list.  links is similar to lynx but with some
graphics support.  Don't remember the standard dependencies but I
believe I used a fork or version that used SDL in framebuffer mode.
It's been a while since I tried it.  I haven't used dillo, but I have
used the D+ fork of dillo and it ports to an impressive number of
operating systems including FreeDOS.  Unfortunately, there's no
JavaScript support and CSS is limited, but it can be a step up from a
text based browser.

The most lightweight webkit based browsers I've been able to find are
netrider (at Sourceforge) and Fifth used by TinyCore Linux.  They're
FLTK based so that means C++ instead of C, but some of the webkit code
is C++ based anyway.  Would love to find a GUI that's lightweight like
FLTK but C based like GTK.  Options are very limited in that area.

I thought uzbl offered vi like key handling:
https://www.uzbl.org/
There's also a list of software supporting vim like keyboard handling here:
https://reversed.top/2016-08-13/big-list-of-vim-like-software/#browsers
My guess is one of those browsers would be the closest to what you're
looking for.

I've also been reading some interesting things about browsing Gemini
servers instead of the web.  There are some nice Gemini browsers out
there.  I personally liked nemini: https://github.com/neonmoe/nemini
but there are several Gemini browsers and I've seen a lot of
recommendations for Lagrange:  https://github.com/skyjake/lagrange  If
you want something that does a much better job with computer
resources, you may want to look into Gemini instead of the World Wide
Web.



[dev][surf] Is there any suckless webkit?

2022-05-02 Thread Robert Winkler
Maybe I am a bit naiv, or technically not informed enough,
BUT:

Is there any webkit/browser that:
- Does not consume most of the computer resources (!!!).
- Is compatible with Java script.
- Displays modern websites without getting stalled?

Ideally there would be a vim-style keybinding available, and, of course,
it should be OS/ hackable.

E.g. I'm running dietpi on a Raspberry Pi 0 W, and up to now I cannot
find a satisfactory answer (512 Mb RAM seem insufficient for running a
'modern' web browser). The only things that more or less run, are the
text browsers (but we are in 2022...) and NetSurf (with Java issues).

I just don't understand that, because I want to only display 2D (!) web
pages. And our flight simulations in the late '90s provided a lot more
graphics with much less CPU/RAM (or do I just not remember right?).

Best regards,
Robert



Re: [dev][surf] Compatibility: "empty" wep pages

2022-04-29 Thread Quentin Rameau
Hi,

> I find that it is unfortunately not satisfactory yet from a 
> privacy-respecting 
> standpoint, at least until it supports plugins such as uMatrix which block 
> Ads 
> and various other privacy-intruding technologies. Simple filtering of URLs 
> just isn't enough.

You could port uMatrix to webkit2gtk, or pay somebody to do it for you.
If you haven't done so yet, you could also have a look at wyebadblock.



Re: [dev][surf] Compatibility: "empty" wep pages

2022-04-29 Thread Страхиња Радић
On 22/04/29 09:48, Robert Winkler wrote:
> Hi, surf is up to now the best browser I found for weak machines such as the 
> Raspberry Pi 0W, with respect to compatibility and customisability (link
> hints, full keyboard control).
> 
> The support of Javascript pages is fair.
> 
> However, some Web Pages do not work at all.
> 
> Example: 
> just produces a white page.

This is how that page (containing Google Analytics and Google Tag Manager) 
looks in surf here:

https://i.imgur.com/lgKot4U.png

While Web itself sucks[1], and surf is a compromise between a suckless shell 
and an engine that sucks (Webkit) for a medium that sucks (HTML+CSS+JS), I find 
that it is unfortunately not satisfactory yet from a privacy-respecting 
standpoint, at least until it supports plugins such as uMatrix which block Ads 
and various other privacy-intruding technologies. Simple filtering of URLs 
just isn't enough.

Until such a moment, I'm using ungoogled-chromium[2] for everyday use.

[1]: https://suckless.org/sucks/web/
[2]: https://github.com/Eloston/ungoogled-chromium


signature.asc
Description: PGP signature


Re: [dev][surf] Compatibility: "empty" wep pages

2022-04-29 Thread Jochen Sprickerhof

Hi Robert,

* Robert Winkler  [2022-04-29 09:48]:

However, some Web Pages do not work at all.

Example: 
just produces a white page.


Works fine here with libwebkit2gtk-4.1-dev version 2.36.1-1+b1 from 
Debian unstable and surf from git.


Cheers Jochen


signature.asc
Description: PGP signature


[dev][surf] Compatibility: "empty" wep pages

2022-04-29 Thread Robert Winkler
Hi, surf is up to now the best browser I found for weak machines such as the 
Raspberry Pi 0W, with respect to compatibility and customisability (link
hints, full keyboard control).

The support of Javascript pages is fair.

However, some Web Pages do not work at all.

Example: 
just produces a white page.

Is there anything, I can do for improving the compatibility?

Obviously, writing the responsible Web Designers for reprogramming their 
pages is not realistic.

Of course, ideally all Web Pages should be functional. 
Otherwise one still has to use the sucking Chromium or Firefox.

Best, Robert




Re: [dev] [surf] Link hints (javascript) not working

2022-04-15 Thread Robert Winkler
On Fri Apr 15, 2022 at 5:12 AM CDT, Viktor Grigorov wrote:
> Hey,
>
> I have a slightly modified linkhints, that i use with both surf and 
> boredserf. I'm attaching it so to forgo more questions, but the gist is:
>    if(e.altKey && String.fromCharCode(e.keyCode) == '1') { hintMode(); }
>   else if(e.altKey && String.fromCharCode(e.keyCode) == '2') { 
> hintMode(true); }
>
> cheers
>
> Apr 15, 2022, 02:05 by robert.wink...@bioprocess.org:
>
> > Used to qutebrowser, vimb and SurfingKeys, I can't use a browser without
> > link hints anymore!
> >
> > I tried , placed it into
> > ~/.surf/script.js and made it executable:
> >
> > ~~~
> > chmod +x script.js
> > ~~~
> >
> > However, no reaction with [CTL]+[SHIFT]+[f].
> >
> > 1) Anything I'm missing (config.h, ...)?
> >
> > 2) How can I re-map the keybindings for another modifier (such as ALT, 
> > Mod4, 
> > or nothing, i.e., just "f')?
> >
> > Best regards,
> > Robert
> >

any idea, why changing '1' to 'f' for link hints with [ALT]+[f] does not
work? I modified your code in script.js to:

~~~
if(e.altKey && String.fromCharCode(e.keyCode) == 'f') { hintMode(); }
~~~

and added the keyId:

~~~
  'U+0070' : 'f',
~~~

Best regards, Robert



Re: [dev] [surf] Link hints (javascript) not working

2022-04-15 Thread Robert Winkler
On Fri Apr 15, 2022 at 5:12 AM CDT, Viktor Grigorov wrote:
> Hey,
>
> I have a slightly modified linkhints, that i use with both surf and 
> boredserf. I'm attaching it so to forgo more questions, but the gist is:
>    if(e.altKey && String.fromCharCode(e.keyCode) == '1') { hintMode(); }
>   else if(e.altKey && String.fromCharCode(e.keyCode) == '2') { 
> hintMode(true); }
>
> cheers
>
> Apr 15, 2022, 02:05 by robert.wink...@bioprocess.org:
>
> > Used to qutebrowser, vimb and SurfingKeys, I can't use a browser without
> > link hints anymore!
> >
> > I tried , placed it into
> > ~/.surf/script.js and made it executable:
> >
> > ~~~
> > chmod +x script.js
> > ~~~
> >
> > However, no reaction with [CTL]+[SHIFT]+[f].
> >
> > 1) Anything I'm missing (config.h, ...)?
> >
> > 2) How can I re-map the keybindings for another modifier (such as ALT, 
> > Mod4, 
> > or nothing, i.e., just "f')?
> >
> > Best regards,
> > Robert
> >

PERFECT solution! Thanks a lot, Viktor!



[dev] [surf] Link hints (javascript) not working

2022-04-14 Thread Robert Winkler
Used to qutebrowser, vimb and SurfingKeys, I can't use a browser without
link hints anymore!

I tried , placed it into
~/.surf/script.js and made it executable:

~~~
chmod +x script.js
~~~

However, no reaction with [CTL]+[SHIFT]+[f].

1) Anything I'm missing (config.h, ...)?

2) How can I re-map the keybindings for another modifier (such as ALT, Mod4, 
or nothing, i.e., just "f')?

Best regards,
Robert




Re: [dev] [surf] segmentation fault

2022-02-10 Thread mb
m...@datameer.com wrote:
> yea, I should do it. The thing is I didn't run into a crash with firefox
> or vimb.

just for correctness.
i was running into the same thing with vimb (they
catch the error and do not crash at all)

so it is obvisuosly a webkit issue.

thx
marko




Re: [dev] [surf] segmentation fault

2022-01-17 Thread mb
Страхиња Радић  wrote:
> On 22/01/13 11:52, m...@datameer.com wrote:
> Why don't you just try it and find out?

I did it and i'm getting the same issue.

> If you are asking me about my personal experience, I always compile surf from
> source.

yes, i was more interrested into personal experience. my fault, next
time i will ask more accurate.

> ...If the binary version of wekbit doesn't work, 
> the only other thing you can try is compile it from source.

yea, I should do it. The thing is I didn't run into a crash with firefox
or vimb.

anyway, i will try to compile webkit as well.

thx
marko




Re: [dev] [surf] segmentation fault

2022-01-13 Thread Страхиња Радић
On 22/01/13 11:52, m...@datameer.com wrote:
> Regarding the note on the website `Compile your own webkit or expect
> hell`...
> Is it better or more stable to compile webkit as well?

Why don't you just try it and find out?

If you are asking me about my personal experience, I always compile surf from
source. I maintain my own personal fork with my choice of patches and
customizations at [1]. I never had any problems yet on Artix with compiling and
using surf with Artix's precompiled webkit.

When using binary packages, you are at the mercy of however the maintainers of
your distro decided to compile it. When you compile software from source, you
have (more) control over how the software is compiled. If the binary version of
wekbit doesn't work, the only other thing you can try is compile it from source.
If that fails too, raise the issue with the maintainers of your distro.

[1]: https://git.sr.ht/~strahinja/surf


signature.asc
Description: PGP signature


Re: [dev] [surf] segmentation fault

2022-01-13 Thread Josuah Demangeon
m...@datameer.com wrote:
> Does that mean I have to compile surf incl all dependencies with
> https://github.com/void-linux/void-packages?
> 
> Or do you have any other hint for me?

Страхиња did show you the way : config.h is the user configuration
file, distributions might also want packages with reasonable config.h
letting other packages putting dependencies on i.e. surf, dmenu, st...

Given the error message:

> segfault at 570 ip 7f3e80b76a34 sp 7ffce08e3148 error 4 in 
> libwebkit2gtk-4.0.so.37.55.5[7f3e806d+2387000]

If you feel like there is something going wrong at surf level rather
than webkit itself (such as wrong use or configuration of webkit),
comparing how webkit is used in another browser could tell.

Another thing to try: first compiling surf from git with the packaged
webkit you already have, then check again to see if it still carshes.
This will tell if the bug can be fixed on surf or webkit level.



Re: [dev] [surf] segmentation fault

2022-01-13 Thread mb
Страхиња Радић  wrote:
> Compiling from source is the intended way to use suckless software.
> 
> Suckless software is configured by editing config.h, rather than by using
> configuration files.

Yes, i'm used to compile my suckless software setup (when i have patches).
In this case I hadn't patches.
So ok, I will compile it.

Regarding the note on the website `Compile your own webkit or expect
hell`...
Is it better or more stable to compile webkit as well?


thx marko




Re: [dev] [surf] segmentation fault

2022-01-12 Thread Страхиња Радић
On 22/01/12 04:02, m...@datameer.com wrote:
> Does that mean I have to compile surf incl all dependencies with
> https://github.com/void-linux/void-packages?

Compiling from source is the intended way to use suckless software.

Suckless software is configured by editing config.h, rather than by using
configuration files.


signature.asc
Description: PGP signature


[dev] [surf] segmentation fault

2022-01-12 Thread mb
Hi,
I'm using voidlinux, dwm, st, dmenu.
I would like to start using surf as my daily web browser.
So I installed the binary verion from the package manager.
`surf-2.1_1` and `webkit2gtk-2.34.2_1`.
After some seconds or minutes of browsing the surf process terminates
with 

```
web process terminated: crashed
zsh: segmentation fault  surf google.de
```

and the log contains

```
2022-01-12T14:37:23.16689 kern.info: [193408.198059] surf[14660]:
segfault at 570 ip 7f3e80b76a34 sp 7ffce08e3148 error 4 in
libwebkit2gtk-4.0.so.37.55.5[7f3e806d+2387000]
2022-01-12T14:37:23.16694 kern.info: [193408.198073] Code: 84 00 00 00
00 00 48 8d 15 c4 5a f2 01 48 8d 35 82 75 f2 01 31 ff e8 ab ad b6 ff 31
c0 5b c3 0f 1f 80 00 00 00 00 48 8b 47 30 <40> 38 b0 f0 00 00 00 74 2b
55 48 8b 2d 13 4e b7 02 40 88 b0 f0 00
```

I read the section `Note On Webkit Versions` on
https://surf.suckless.org/

Does that mean I have to compile surf incl all dependencies with
https://github.com/void-linux/void-packages?

Or do you have any other hint for me?

thx
marko


-- 
Marko Bauhardt
Datameer GmbH

e.  m...@datameer.com
w.  http://www.datameer.com/
a.  Magdeburger Straße 23, 06112 Halle (Saale), Amtsgericht Stendal, HRB: 
10348
Geschäftsführer: Frank Henze

Request Datameer Spectrum Demo: https://bit.ly/38IlOe5




[dev] surf: mouse button: 8, 9

2021-12-30 Thread René
Hi,
I found the values in the subject although I remember the mouse
numbers are in range (0, 5> e.g. 1 means left btn, 2 middle and 3
right button. What are these for?!? Thanks
Rene



Re: [dev] [surf] XDG conformity

2021-12-19 Thread Quentin Rameau
Hi Janek,

> After trying surf recently, I was appalled to see a ".surf" directory in my 
> home.
> Is XDG basedir compliance not natural in suckless software?

I won't answer directly this question, as you might be able yourself to
look that up.

But if you're asking about surf specifically, you can configure the
directories used by surf in config.h.



Re: [dev] [surf] XDG conformity

2021-12-19 Thread Страхиња Радић
On 21/12/16 09:39, Janek F wrote:
> After trying surf recently, I was appalled to see a ".surf" directory in my 
> home.
> Is XDG basedir compliance not natural in suckless software?

Suckless software follows the principles that predate X Desktop Group and its
specifications, as well as its own principles.

Before 2000, it was customary in GNU/Linux to have user-specific configuration
files in the user's home directory, starting with a dot. For example, vim's
configuration file is ~/.vimrc, joe's configuration file is ~/.joerc and so on.
Those files are commonly called "dotfiles", because they literally start with a
dot, and programs like ls omit listing them by default (they are "hidden").

In addition, suckless software has its own convention, which is to configure
software by changing a header file in its source code, usually located in the
file config.h in the source directory of a particular program.


signature.asc
Description: PGP signature


Re: [dev] [surf] XDG conformity

2021-12-18 Thread Michael Hendricks
Hi Janek,

> After trying surf recently, I was appalled to see a ".surf"
> directory in my home.  Is XDG basedir compliance not natural in
> suckless software?

dmenu is the only suckless software I know that does anything related
to the XDG basedir spec.  I think the suckless way is to implement one
simple approach and let users patch in their favorite way.

A thread from 2010[1] suggests that many suckless users don't favor
the XDG approach.  My setup has XDG_* variables, but I wouldn't expect
support from suckless out of the box.

I hope that helps.

1: https://lists.suckless.org/dev/1012/6624.html



[dev] [surf] open link in another application

2021-12-06 Thread lars.niesen
Hi,

Recently I started to use surf as my daily driver. One problem I
encountered is that I am unable to open a link in another application.
For example Zoom: We receive our invitations via an internal link,
which then opens a web interface. That interface then starts the zoom
client. Sadly I could not find a patch to create this behavior.

Have I overlooked such a patch or is there none?
If there is none, I would try to implement that feature as a patch.

Regards,
Lars N


signature.asc
Description: PGP signature


Re: [dev] surf ephemeral not switching(?)

2021-10-25 Thread Quentin Rameau
> Hey,

Hi Viktor,

> Usually I clean out ~/.surf/cache/localstorage for all but 2 sites. I found 
> out the emphemeral option could acomplish just that, and setting up peruri 
> options with all 3 permutations (each being same priority) turned out to not 
> work. It's either on, or off, as evidenced by the files being created or not, 
> and the userscript not accessing (or not being able to access) the locally 
> stored settings in the above dir. I make'd surf with a new keyboard command 
> to toggle ephemeral, but to no avail. 
> Am I missing something, or is this unexpected behavior?

Indeed, the ephemeral parameter can't be a togglable parameter.

I have in the pipes the project of having per-domain isolation,
regarding cache/cookies etc., and ephemeral would be one of this.

But current $job gets the most of me and I have no time left for this
currently.



[dev] surf ephemeral not switching(?)

2021-10-22 Thread Viktor Grigorov
Hey,

Usually I clean out ~/.surf/cache/localstorage for all but 2 sites. I found out 
the emphemeral option could acomplish just that, and setting up peruri options 
with all 3 permutations (each being same priority) turned out to not work. It's 
either on, or off, as evidenced by the files being created or not, and the 
userscript not accessing (or not being able to access) the locally stored 
settings in the above dir. I make'd surf with a new keyboard command to toggle 
ephemeral, but to no avail. 
Am I missing something, or is this unexpected behavior?





Re: [dev] surf: copy and paste

2021-10-18 Thread Quentin Rameau
> Hello,

Hi Alex,

> Wanted to ask if there is any way to copy and paste text in surf like in 
> any other browser, using the usual ctrl+c/v keybindings.

I don't know about “any other browser”, we have yet to produce an
exhaustive list of (I suppose you mean web) browsers.

But I think that GTK default bindings maps ^C and ^V to clipboard
access (I think there exist others, like Shift+Ins for pasting, but you
should check those).

Check that the keybindings you build don't override those though.

> Trying to use surf as my main driver.need the copy/paste function.

You can also use the primary copy buffer instead of the clipboard,
there you just have to select text for copying it, and the middle click
for pasting it.

> And if there is a patch or some code I could use to achieve this.

You shouldn't need any.

> Thanks)))

You're welcome!



[dev] surf: copy and paste

2021-10-18 Thread Alex Beakes

Hello,

Wanted to ask if there is any way to copy and paste text in surf like in 
any other browser, using the usual ctrl+c/v keybindings.

Trying to use surf as my main driver.need the copy/paste function.

And if there is a patch or some code I could use to achieve this.

Thanks)))

Alex



Re: [dev] surf: copy and paste

2021-10-18 Thread Greg Reagle
On Mon, Oct 18, 2021, at 2:36 PM, Alex Beakes wrote:
> Wanted to ask if there is any way to copy and paste text in surf like in 
> any other browser, using the usual ctrl+c/v keybindings.
> Trying to use surf as my main driver.need the copy/paste function.

FYI, I am using Debian Stable 11 and X11 (dwm).  I just cloned surf and built 
and ran it (I did not use the Debian package which is older), and here is the 
behavior that I get:  Paste can be achieved by Control-v and/or Shift-Insert.  
Copy can be achieve by Control-Insert.

Since these keys are not specified in config.def.h of surf, I assume that they 
come along with a library on which surf depends.

Note that these operations use the CLIPBOARD selection, which is what I expect 
[1].  It is also possible to use the PRIMARY selection in X11, as explained in 
[1].

[1] https://freedesktop.org/wiki/Specifications/ClipboardsWiki/



Re: [dev] [surf] content filter interest check

2021-05-17 Thread Jonathan Bakke
(Apologies for this inelegant reply to 
https://lists.suckless.org/dev/2105/34317.html)

Greetings, Quentin.

I hadn't seen wyebadblock; that looks like a great backstop and I'll try it 
soon. Thanks for pointing it out, and for helping me think about this in the 
larger context of webkitgtk rather than only about surf. My intention, though, 
is more like "upwardly mobile lynx" than "chrome with less chrome", so ad 
blocking is both more and less than I want.

Your advice to start off easy is well received. I do tend to contemplate 
projects well beyond my abilities. My current plan: clean up my existing code 
so that my patch should merely give surf the ability to apply a 
config.h-specified, WebKit-spec JSON rules file. Then, I'll put together a rule 
authoring utility from the logic in another app of mine, but using _SURF_URI 
instead of Apple's share extension, terminal text instead of interface builder, 
and SIGHUP instead of a Safari extension.

>From there, who knows...but I do enjoy seeing other perspectives, and I hope 
>the tools I make can help others as well.

Cheers,
Jon



Re: [dev] [surf] content filter interest check

2021-05-17 Thread Jonathan Bakke
> When it comes to feature sets, I might be considered to be extreme but I just 
> love Adnauseam (adnauseam.io) which is an agressive take on content 
> filtering. From what I can tell though, this community cares about privacy 
> and any way tracking and/or fingerprinting can be avoided is a welcome change.
>
> Anyway, have a great one!
> -Benjamin Chausse

Benjamin,

Thank you for your thoughts and the enthusiasm! I'll be sharing patches, then, 
when it comes together a bit more.

I hadn't seen Adnauseam before; thanks! It amuses me and I like the novelty of 
that approach.

Cheers,
Jon



Re: [dev] [surf] content filter interest check

2021-05-16 Thread Quentin Rameau
> Hi there John,

Hello Benjamin,

> > Is anyone interested in using surf with WebKit content filtering?
> >
> > If so, I'd like to see your must-have features and can't-have excesses. But 
> > a mere yea or nay would also be informative, if perhaps more suitable for 
> > direct contact.
> >  
> 
> Your idea sounds great, and my opinion it, would be a great addition to surf! 
> I have tried many times to make surf my de-facto web browser but realized 
> over time that it lacked three things to achieve this:
> => Good content filtering

As I said, it already has through wyebadblock

> => Good password management (autofill is a must)  

Good password management is your brain.
I see autofill almost as much secure as having no password or the same
one everywhere.
Maybe somebody will write an external patch for it though.

> With those three combined, surf would be (again, in my opinion) the best of 
> the best.

What's the third one?



Re: [dev] [surf] content filter interest check

2021-05-16 Thread Benjamin Chausse
Hi there John,

>
> Is anyone interested in using surf with WebKit content filtering?
>
> If so, I'd like to see your must-have features and can't-have excesses. But a 
> mere yea or nay would also be informative, if perhaps more suitable for 
> direct contact.
>

Your idea sounds great, and my opinion it, would be a great addition to surf! I 
have tried many times to make surf my de-facto web browser but realized over 
time that it lacked three things to achieve this:
=> Good content filtering
=> Good password management (autofill is a must)

With those three combined, surf would be (again, in my opinion) the best of the 
best.

When it comes to feature sets, I might be considered to be extreme but I just 
love Adnauseam (adnauseam.io) which is an agressive take on content filtering. 
From what I can tell though, this community cares about privacy and any way 
tracking and/or fingerprinting can be avoided is a welcome change.

Anyway, have a great one!
-Benjamin Chausse


signature.asc
Description: PGP signature


Re: [dev] [surf] content filter interest check

2021-05-16 Thread Sebastian LaVine

On 5/16/21 2:45 PM, Quentin Rameau wrote:

=> Good password management (autofill is a must)


Good password management is your brain.
I see autofill almost as much secure as having no password or the same
one everywhere.


Good password management is pass[0] plus passmenu[1]!

[0]: https://www.passwordstore.org/
[1]: https://git.zx2c4.com/password-store/tree/contrib/dmenu

--
Sebastian LaVine | https://smlavine.com






OpenPGP_0x819C7D054C7C1465.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: [dev] [surf] content filter interest check

2021-05-16 Thread Quentin Rameau
Hello Jonathan,

> Launch delays might be a problem as WebKit seems to want to compile the 
> filtering binary from a json rules file upon  each and every launch. But I 
> believe that is an optimization issue which I can address later. (Short term, 
> I'll do what I can and you can opt out. Perhaps, medium-term, mimic 
> emacs-server. Long term, maybe help develop an API that abstracts the 
> renderer from the interface -- I suspect one imperative of "suck less" is 
> "pipe more".)

Have you looked at wyebadblock?

> Your feedback is truly welcome, even if entirely negative. Questions are 
> encouraged; accessibility concerns will be given particular attention.

Well, it's nice to read about your interest in surf. I don't know about
your skill level and motivation endurance, maybe start by doing
something not too complex to get aquainted with webkitgtk and its DOM
API, something that you won't take a year to do and can use quickly.

One thing that comes in mind is a webextention for having keyboard
“hints” on webpage (so that you can access links through a combination
of alnums instead of having to clickety-click everything).

In any case, good luck!



[dev] [surf] content filter interest check

2021-05-15 Thread Jonathan Bakke
Well met.

I wrote a WebKit content filter for surf. It is over a hundred lines of ugly 
and slow, so no patch is included, but surf is now in my future. I'd be happy 
to continue kludging along with my own podge of content-mining tools, but I'd 
also be pleased to put on a spit of polish and share it with others. So:

Is anyone interested in using surf with WebKit content filtering?

If so, I'd like to see your must-have features and can't-have excesses. But a 
mere yea or nay would also be informative, if perhaps more suitable for direct 
contact.

My thought, at the moment: this idea is good, but both launch delays and 
time-to-fix need to be minimized.

Launch delays might be a problem as WebKit seems to want to compile the 
filtering binary from a json rules file upon  each and every launch. But I 
believe that is an optimization issue which I can address later. (Short term, 
I'll do what I can and you can opt out. Perhaps, medium-term, mimic 
emacs-server. Long term, maybe help develop an API that abstracts the renderer 
from the interface -- I suspect one imperative of "suck less" is "pipe more".)

Time-to-fix is a fascinating design challenge. I'm assuming a 
deny-globally/allow-exceptionally approach, so every page is broken and many 
will need to be unbroken to the user's satisfaction -- with minimal 
interruption to flow. I see a two-tier solution: (1) a surf patch that 
escalates permissions along a compile-time configurable continuum, and (2) a 
distinct utility that facilitates request auditing and rule authoring (which 
I'm tempted to name 'turf'), as if uMatrix meets the web inspector pane and has 
a baby which is raised by curl. But it might be more suckless to determine 
rules at compile time and leave authoring and such to a completely independent 
utility.

I'm open to -- I'm asking for -- criticism and guidance.

Would a translator to/from uBlock dynamic rules facilitate interest? (I'm 
thinking about doing this anyhow.) How about apps that apply the same rules to 
iOS/macOS Safari? (Already part of my daily kit.) Or expanding the 
request-auditing utility to include overlapping webdev tools? (I've little clue 
what you do, but I'd benefit from learning more. Yeah, I over-sold you in 
paragraph seven. Sorry. I'm incurably optimistic, both an under- and 
over-achiever. As will happen here.)

Your feedback is truly welcome, even if entirely negative. Questions are 
encouraged; accessibility concerns will be given particular attention.

I salute you who make such projects possible. One cheer for those who can; two 
cheers for those who do; three cheers for who came before and made it 
tried-and-true.

Sincerely,
Jon



Re: [dev] [surf] Releasing surf?

2020-11-20 Thread Ivan "Rambius" Ivanov
Hello Quentin,

On Fri, Nov 20, 2020 at 2:36 AM Quentin Rameau  wrote:
>
> On Thu, 19 Nov 2020 15:33:44 -0500
> "Ivan \"Rambius\" Ivanov"  wrote:
>
> > Hello,
>
> Hello Ivan,
>
> > I have been using dwm with netbsd for some time and I am happy with it
> > and I decided to try surf as well. I was able to build and run surf
> > from git head with no problems. I tried to build surf-2.0 (downloaded
> > from https://dl.suckless.org/surf/surf-2.0.tar.gz) but I got some X11
> > runtime errors.
>
> Thank you for your interest in surf.
You are most welcome!

>
> > Do you have plans to release a new version of surf? Thank you for your
> > answers in advance.
>
> I was waiting on some eventual feedback after the last recent batch of
> patches before releasing, but yes we will do a new release soon!

Do you need help testing the patches? If you give me scenarios / use
cases to test, I may be of further help.

Regards
rambius


-- 
Tangra Mega Rock: http://www.radiotangra.com



Re: [dev] [surf] Releasing surf?

2020-11-20 Thread Quentin Rameau
On Thu, 19 Nov 2020 15:33:44 -0500
"Ivan \"Rambius\" Ivanov"  wrote:

> Hello,

Hello Ivan,

> I have been using dwm with netbsd for some time and I am happy with it
> and I decided to try surf as well. I was able to build and run surf
> from git head with no problems. I tried to build surf-2.0 (downloaded
> from https://dl.suckless.org/surf/surf-2.0.tar.gz) but I got some X11
> runtime errors.

Thank you for your interest in surf.

> Do you have plans to release a new version of surf? Thank you for your
> answers in advance.

I was waiting on some eventual feedback after the last recent batch of
patches before releasing, but yes we will do a new release soon!



[dev] [surf] Releasing surf?

2020-11-19 Thread Ivan "Rambius" Ivanov
Hello,

I have been using dwm with netbsd for some time and I am happy with it
and I decided to try surf as well. I was able to build and run surf
from git head with no problems. I tried to build surf-2.0 (downloaded
from https://dl.suckless.org/surf/surf-2.0.tar.gz) but I got some X11
runtime errors.

Do you have plans to release a new version of surf? Thank you for your
answers in advance.

Regards
rambius

-- 
Tangra Mega Rock: http://www.radiotangra.com



Re: [dev] [surf] LibEGL warning : DRI2 : Failed to authenticate

2020-11-12 Thread Quentin Rameau
Hello Ben,

> Using OpenBSD 6.8 arm64 on RPi 4.
> 
> I recieve the following warning while running surf as both a regular and root 
> user:
> "LibGL warning : DRI2 : Failed to authenticate"
> 
> Surf has been running slow on this particular computer and I suspect this 
> warning has 
> something to do with it. I've tried installing surf through the package 
> manager as well
> as building it from source. Neither resolves the warning/issue.
> 
> Any help or insight would definitely be apprciated. 

Well, this isn't a surf issue but a webkit one.

You don't have DRI support over-there, or at least it's failing, but I
can't know why.

You could try though try disable 2d acceleration, which is enabled by
default, by deactivating the AcceleratedCanvas in the configuration,
but that won't solve your driver issue, just maybe remove the warning.



[dev] [surf] LibEGL warning : DRI2 : Failed to authenticate

2020-11-06 Thread Ben
Using OpenBSD 6.8 arm64 on RPi 4.

I recieve the following warning while running surf as both a regular and root 
user:
"LibGL warning : DRI2 : Failed to authenticate"

Surf has been running slow on this particular computer and I suspect this 
warning has 
something to do with it. I've tried installing surf through the package manager 
as well
as building it from source. Neither resolves the warning/issue.

Any help or insight would definitely be apprciated. 

Thank you.




Re: [dev] [surf][bug] bug in pipe communication to extension

2020-10-17 Thread Jochen Sprickerhof

Hi Jona,

* Jona Ackerschott  [2020-10-17 09:53]:

To reproduce this bug, execute mainline surf without patches, go to 'google.com'
(Exactly this, combinations of 'http(s)' or 'www' added to this
can change the behaviour) and then to 'twitter.com' (Again extactly this).
These sites are just one example, this also happens with other sites,
mostly pretty bloated ones.
You should see that 'twitter.com' is not loading and the error messages
'webext: error sending: i', 'webext: message too short: %i' (where %i is
some negative integer).
There is also a variation of this bug, where you find only the first
error message and the page is loading in a finite amount of time.


Confirmed.


I think all this behaviour can be traced back to the fact, that the
pipes are being closed to early in readpipe, because they could be
needed again.
A fix could be to let those pipes open during runtime and only close
them in the 'cleanup' function.
At least this fixes all the problems i have talked about.


Please send a patch for discussion.

Cheers Jochen


signature.asc
Description: PGP signature


Re: [dev] [surf][bug] bug in pipe communication to extension

2020-10-17 Thread Jona Ackerschott
Hello Hiltjo,

So i found the specific problem present in the code, it works as
follows: Wenn surf gets started, it sets up the two communication pipes,
the surf web extension gets initialized and 'initwebextensions' in surf.c
gets called.
This function sends the numbers for the two file descriptors to the
extension.
Afterwards, the web process gets forked off, the two file descriptors
get copied and the extension code notifies surf through the pipes, so
that surf can close the reading end of 'pipeout' and the writing end of
'pipein'.

So far so good, now the extension can use the pipes for communication.
In some cases though, a new web process gets started, which again
initializes the web extension and calls 'initwebextensions'.
This web extension however, now receives the integers for the already
closed file descriptors, which leads probably to undefined behaviour.

My fix for this (see attachment for the patch) would be to just send a boolean 
value to the web
extension, which tells it, if this is the first invocation or not.
On the first invocation the extension can just do what it is used to and
on the second it does nothing.
This is more legit than to prevent the second invocation entirely, as
webkit doesn't really provide any useful functions for this.

Also, i closed all unnecesary file descriptors on the side of the web
extension. It is kind of weird that no one did this before, given that
you were going to the trouble of an extra communication step, just to
close those on surf's side.

Kind Regards,
Jona
>From 4e1cdd8f58ca69091dc913b4d882c59756c7004f Mon Sep 17 00:00:00 2001
From: Jona Ackerschott 
Date: Sat, 17 Oct 2020 18:59:51 +0200
Subject: [PATCH] Fix multiple extension inits.

---
 libsurf-webext.c | 28 +++-
 surf.c   |  5 -
 2 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/libsurf-webext.c b/libsurf-webext.c
index ec9a235..2ae0eb8 100644
--- a/libsurf-webext.c
+++ b/libsurf-webext.c
@@ -114,15 +114,25 @@ webpagecreated(WebKitWebExtension *e, WebKitWebPage *wp, 
gpointer unused)
 G_MODULE_EXPORT void
 webkit_web_extension_initialize_with_user_data(WebKitWebExtension *e, GVariant 
*gv)
 {
+   int win, rout;
+   gboolean firstinit;
GIOChannel *gchanpipe;
 
-   g_signal_connect(e, "page-created", G_CALLBACK(webpagecreated), NULL);
-
-   g_variant_get(gv, "(ii)", , );
-   msgsurf(NULL, "i");
-
-   gchanpipe = g_io_channel_unix_new(pipein);
-   g_io_channel_set_encoding(gchanpipe, NULL, NULL);
-   g_io_channel_set_close_on_unref(gchanpipe, TRUE);
-   g_io_add_watch(gchanpipe, G_IO_IN, readpipe, NULL);
+   g_variant_get(gv, "(b)", , , , , 
);
+   close(win);
+   close(rout);
+   /* Only do something on first initialization */
+   if (firstinit) {
+   msgsurf(NULL, "i");
+
+   g_signal_connect(e, "page-created", G_CALLBACK(webpagecreated), 
NULL);
+
+   gchanpipe = g_io_channel_unix_new(pipein);
+   g_io_channel_set_encoding(gchanpipe, NULL, NULL);
+   g_io_channel_set_close_on_unref(gchanpipe, TRUE);
+   g_io_add_watch(gchanpipe, G_IO_IN, readpipe, NULL);
+   } else {
+   close(pipein);
+   close(pipeout);
+   }
 }
diff --git a/surf.c b/surf.c
index 2b54e3c..ea26849 100644
--- a/surf.c
+++ b/surf.c
@@ -253,6 +253,7 @@ static Parameter *curconfig;
 static int modparams[ParameterLast];
 static int pipein[2], pipeout[2];
 char *argv0;
+static int firstextinit = 1;
 
 static ParamName loadtransient[] = {
Certificate,
@@ -1242,10 +1243,12 @@ initwebextensions(WebKitWebContext *wc, Client *c)
if (!pipeout[0] || !pipein[1])
return;
 
-   gv = g_variant_new("(ii)", pipeout[0], pipein[1]);
+   gv = g_variant_new("(b)", firstextinit, pipeout[0], pipeout[1], 
pipein[0], pipein[1]);
 
webkit_web_context_set_web_extensions_initialization_user_data(wc, gv);
webkit_web_context_set_web_extensions_directory(wc, WEBEXTDIR);
+
+   firstextinit = 0;
 }
 
 GtkWidget *
-- 
2.28.0



Re: [dev] [surf][bug] bug in pipe communication to extension

2020-10-17 Thread Jona Ackerschott
Hello Hiltjo,

> Where is the patch?
Sorry, see the appendix of this mail.

First let me say that i never worked with the codebase of surf before.
I realised that my previous understanding of this bug seems to be
partially wrong, so this patch works, but i don't know why exactly.
My idea to avoid the readpipe function is probably bullshit, so you
could as well just ignore this patch.

The underlying problem continues to be the fact, that the web extension
can be initialized multiple times, but i didn't figure out yet, why this
should lead to some broken pipe.
I will get back to you if i do.

Regards,
Jona
>From edf2be7f3390d9714c51771aab25c89d14cea86b Mon Sep 17 00:00:00 2001
From: Jona Ackerschott 
Date: Sat, 17 Oct 2020 11:46:11 +0200
Subject: [PATCH] Fix communication through closed pipe

---
 libsurf-webext.c | 23 ++-
 surf.c   | 45 +
 2 files changed, 7 insertions(+), 61 deletions(-)

diff --git a/libsurf-webext.c b/libsurf-webext.c
index ec9a235..6fa7364 100644
--- a/libsurf-webext.c
+++ b/libsurf-webext.c
@@ -18,7 +18,7 @@ typedef struct Page {
struct Page *next;
 } Page;
 
-static int pipein, pipeout;
+static int pipein;
 static Page *pages;
 
 Page *
@@ -38,24 +38,6 @@ newpage(WebKitWebPage *page)
return p;
 }
 
-static void
-msgsurf(Page *p, const char *s)
-{
-   static char msg[MSGBUFSZ];
-   size_t sln = strlen(s);
-   int ret;
-
-   if ((ret = snprintf(msg, sizeof(msg), "%c%c%s",
-   2 + sln, p ? p->id : 0, s))
-   >= sizeof(msg)) {
-   fprintf(stderr, "webext: message too long: %d\n", ret);
-   return;
-   }
-
-   if (pipeout && write(pipeout, msg, sizeof(msg)) < 0)
-   fprintf(stderr, "webext: error sending: %.*s\n", ret-2, msg+2);
-}
-
 static gboolean
 readpipe(GIOChannel *s, GIOCondition c, gpointer unused)
 {
@@ -118,8 +100,7 @@ 
webkit_web_extension_initialize_with_user_data(WebKitWebExtension *e, GVariant *
 
g_signal_connect(e, "page-created", G_CALLBACK(webpagecreated), NULL);
 
-   g_variant_get(gv, "(ii)", , );
-   msgsurf(NULL, "i");
+   g_variant_get(gv, "(i)", );
 
gchanpipe = g_io_channel_unix_new(pipein);
g_io_channel_set_encoding(gchanpipe, NULL, NULL);
diff --git a/surf.c b/surf.c
index 2b54e3c..2a8edbd 100644
--- a/surf.c
+++ b/surf.c
@@ -185,7 +185,6 @@ static gboolean buttonreleased(GtkWidget *w, GdkEvent *e, 
Client *c);
 static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event,
 gpointer d);
 static gboolean winevent(GtkWidget *w, GdkEvent *e, Client *c);
-static gboolean readpipe(GIOChannel *s, GIOCondition ioc, gpointer unused);
 static void showview(WebKitWebView *v, Client *c);
 static GtkWidget *createwindow(Client *c);
 static gboolean loadfailedtls(WebKitWebView *v, gchar *uri,
@@ -251,7 +250,7 @@ static char *stylefile;
 static const char *useragent;
 static Parameter *curconfig;
 static int modparams[ParameterLast];
-static int pipein[2], pipeout[2];
+static int pipeout[2];
 char *argv0;
 
 static ParamName loadtransient[] = {
@@ -343,13 +342,8 @@ setup(void)
 
gdkkb = gdk_seat_get_keyboard(gdk_display_get_default_seat(gdpy));
 
-   if (pipe(pipeout) < 0 || pipe(pipein) < 0) {
+   if (pipe(pipeout) < 0) {
fputs("Unable to create pipes\n", stderr);
-   } else {
-   gchanin = g_io_channel_unix_new(pipein[0]);
-   g_io_channel_set_encoding(gchanin, NULL, NULL);
-   g_io_channel_set_close_on_unref(gchanin, TRUE);
-   g_io_add_watch(gchanin, G_IO_IN, readpipe, NULL);
}
 
 
@@ -1038,7 +1032,6 @@ spawn(Client *c, const Arg *a)
if (fork() == 0) {
if (dpy)
close(ConnectionNumber(dpy));
-   close(pipein[0]);
close(pipeout[1]);
setsid();
execvp(((char **)a->v)[0], (char **)a->v);
@@ -1073,7 +1066,7 @@ cleanup(void)
while (clients)
destroyclient(clients);
 
-   close(pipein[0]);
+   close(pipeout[0]);
close(pipeout[1]);
g_free(cookiefile);
g_free(scriptfile);
@@ -1206,43 +1199,15 @@ newview(Client *c, WebKitWebView *rv)
return v;
 }
 
-static gboolean
-readpipe(GIOChannel *s, GIOCondition ioc, gpointer unused)
-{
-   static char msg[MSGBUFSZ], msgsz;
-   GError *gerr = NULL;
-
-   if (g_io_channel_read_chars(s, msg, sizeof(msg), NULL, ) !=
-   G_IO_STATUS_NORMAL) {
-   fprintf(stderr, "surf: error reading pipe: %s\n",
-   gerr->message);
-   g_error_free(gerr);
-   return TRUE;
-   }
-   if ((msgsz = msg[0]) < 3) {
-   fprintf(stderr, "surf: message too short: %d\n", msgsz);
-   return TRUE;
-   }
-
-   switch (msg[2]) {
-   case 'i':
-   

Re: [dev] [surf][bug] bug in pipe communication to extension

2020-10-17 Thread Hiltjo Posthuma
On Sat, Oct 17, 2020 at 09:53:47AM +0200, Jona Ackerschott wrote:
> Dear suckless community,
> 

Hi Jona,

> There seems to be a bug in surf, in the 'readpipe' function in surf.c.
> The pipes for communication with the web extension are being closed
> there in the switch statement, which is problematic, because this function is 
> called every time
> the web extension is initialized.
> This desing seems to be chosen on the assumption that the surf web extension
> will only be initialized once.
> However, this is not the case and as soon as the web extension gets
> initialized a second time the current page may be loading forever.
> 
> To reproduce this bug, execute mainline surf without patches, go to 
> 'google.com'
> (Exactly this, combinations of 'http(s)' or 'www' added to this
> can change the behaviour) and then to 'twitter.com' (Again extactly this).
> These sites are just one example, this also happens with other sites,
> mostly pretty bloated ones.
> You should see that 'twitter.com' is not loading and the error messages
> 'webext: error sending: i', 'webext: message too short: %i' (where %i is
> some negative integer).
> There is also a variation of this bug, where you find only the first
> error message and the page is loading in a finite amount of time.
> 
> I think all this behaviour can be traced back to the fact, that the
> pipes are being closed to early in readpipe, because they could be
> needed again.
> A fix could be to let those pipes open during runtime and only close
> them in the 'cleanup' function.
> At least this fixes all the problems i have talked about.
> 

Where is the patch?

> Regards,
> Jona
> 

-- 
Kind regards,
Hiltjo



[dev] [surf][bug] bug in pipe communication to extension

2020-10-17 Thread Jona Ackerschott
Dear suckless community,

There seems to be a bug in surf, in the 'readpipe' function in surf.c.
The pipes for communication with the web extension are being closed
there in the switch statement, which is problematic, because this function is 
called every time
the web extension is initialized.
This desing seems to be chosen on the assumption that the surf web extension
will only be initialized once.
However, this is not the case and as soon as the web extension gets
initialized a second time the current page may be loading forever.

To reproduce this bug, execute mainline surf without patches, go to 'google.com'
(Exactly this, combinations of 'http(s)' or 'www' added to this
can change the behaviour) and then to 'twitter.com' (Again extactly this).
These sites are just one example, this also happens with other sites,
mostly pretty bloated ones.
You should see that 'twitter.com' is not loading and the error messages
'webext: error sending: i', 'webext: message too short: %i' (where %i is
some negative integer).
There is also a variation of this bug, where you find only the first
error message and the page is loading in a finite amount of time.

I think all this behaviour can be traced back to the fact, that the
pipes are being closed to early in readpipe, because they could be
needed again.
A fix could be to let those pipes open during runtime and only close
them in the 'cleanup' function.
At least this fixes all the problems i have talked about.

Regards,
Jona



[dev] [surf] disabling css

2020-04-21 Thread Szabolcs Szucs
Hello,

I've been using surf for a few months now. Been on dwm for ~6yrs.

Q - Is there an easy way to disable CSS in surf?

I guess there is, and it's probably via the site specific css files. I think my 
CSS-fu is not good enough though. I tried putting "* {}" into default.css, 
which is matched .* sites (as in git tip config.h), but that's just *adding* 
*nothing* to all the elements as far as I know. I have no other ideas at the 
moment.

Is there a patch for this maybe? If not, and the way to go is a new patch, do 
you have any advice/recommendation for me before I start hacking around?

Thanks,
Szab




Re: [dev] [surf] Cannot copy URL to clipboard

2020-03-06 Thread Jason Blocklove
> I can't reproduce the issue. ^Y and ^P both act on PRIMARY correctly here.
> I am testing on current HEAD (d068a38).
>
> Double check that your system isn't doing something weird like "bridging"
> or merging PRIMARY and CLIPBOARD.
>
> Best regards,
> David
>

I don't believe my system has anything like bridging set up, as I can
usually use my two clipboards entirely separately. That said, I found
the "clipboard instead of primary" patch which technically solves this
problem for me. Thanks, though!

Cheers,
Jason



Re: [dev] [surf] Cannot copy URL to clipboard

2020-03-06 Thread David Phillips
On Wed, Mar 04, 2020 at 04:27:38PM -0500, Jason Blocklove wrote:
> I've just reinstalled surf from scratch and everything seems to work as
> expected so far except that I can't seem to use  to copy the
> current page's URL. I've tried both with the primary selection as well
> as the clipboard itself and sadly no dice with either. Any ideas what
> might be going wrong?
> 
> Cheers,
> Jason

I can't reproduce the issue. ^Y and ^P both act on PRIMARY correctly here.
I am testing on current HEAD (d068a38).

Double check that your system isn't doing something weird like "bridging"
or merging PRIMARY and CLIPBOARD.

Best regards,
David



[dev] [surf] Cannot copy URL to clipboard

2020-03-04 Thread Jason Blocklove
I've just reinstalled surf from scratch and everything seems to work as
expected so far except that I can't seem to use  to copy the
current page's URL. I've tried both with the primary selection as well
as the clipboard itself and sadly no dice with either. Any ideas what
might be going wrong?

Cheers,
Jason



Re: [dev] [surf] can't follow a link for download

2020-02-22 Thread Renato A . Galvão
2020-02-20 14:15 GMT-03:00, Reiner Herrmann :
> On Thu, Feb 20, 2020 at 02:05:01PM -0300, Renato A. Galvão wrote:
>> >>> surf: execvp x-terminal-emulator failed: Permission denied
>>
>> There is an apparmor file,
>>
>> /etc/apparmor.d/usr.bin.surf
>>
> [...]
>>   /usr/bin/stterm ix,
>
> In the past st was shipped in the stterm package with only an stterm
> binary.
> Nowaways the stterm package includes the st binary again (and a symlink
> from stterm to st). But AppArmor doesn't seem to follow symlinks.
> I will update the surf profile in the next upload. Thanks for the hint.
>
> Regards,
>   Reiner
>

Thank you for your support.



Re: [dev] [surf] can't follow a link for download

2020-02-20 Thread Reiner Herrmann
On Thu, Feb 20, 2020 at 02:05:01PM -0300, Renato A. Galvão wrote:
> >>> surf: execvp x-terminal-emulator failed: Permission denied
> 
> There is an apparmor file,
> 
> /etc/apparmor.d/usr.bin.surf
> 
[...]
>   /usr/bin/stterm ix,

In the past st was shipped in the stterm package with only an stterm
binary.
Nowaways the stterm package includes the st binary again (and a symlink
from stterm to st). But AppArmor doesn't seem to follow symlinks.
I will update the surf profile in the next upload. Thanks for the hint.

Regards,
  Reiner


signature.asc
Description: PGP signature


Re: [dev] [surf] can't follow a link for download

2020-02-20 Thread Renato A . Galvão
2020-02-20 11:33 GMT-03:00, Renato A. Galvão :
> 2020-02-20 10:35 GMT-03:00, Greg Reagle :
>> On Thu, Feb 20, 2020, at 08:26, Renato A. Galvão wrote:
>>> I use the packaged version buster (stable) of surf in Debian.
>>>
>>> While trying to make any download I'm receiving this:
>>>
>>> surf: execvp x-terminal-emulator failed: Permission denied
>>
>> Run the command x-terminal-emulator from a shell prompt.  What happens?
>>
>> Also, try these commands:
>> ls -l $(which x-terminal-emulator)
>> ls -l /etc/alternatives/x-terminal-emulator
>>
>>
>
> It opens st, which is my default terminal emulator.
>
> ls -l $(which x-terminal-emulator)
> lrwxrwxrwx 1 root root 37 jun 17  2016 /usr/bin/x-terminal-emulator ->
> /etc/alternatives/x-terminal-emulator
>
> ls -l /etc/alternatives/x-terminal-emulator
> lrwxrwxrwx 1 root root 11 jul 14  2019
> /etc/alternatives/x-terminal-emulator -> /usr/bin/st
>

There is an apparmor file,

/etc/apparmor.d/usr.bin.surf

where the following directives is found:

  # for downloading files
  /dev/ptmx rw,
  /dev/pts/* rw,
  /usr/bin/stterm ix,
  # unconfined because it is called in (and downloading to) the cwd
  /usr/bin/curl Ux,



Re: [dev] [surf] can't follow a link for download

2020-02-20 Thread Renato A . Galvão
2020-02-20 10:35 GMT-03:00, Greg Reagle :
> On Thu, Feb 20, 2020, at 08:26, Renato A. Galvão wrote:
>> I use the packaged version buster (stable) of surf in Debian.
>>
>> While trying to make any download I'm receiving this:
>>
>> surf: execvp x-terminal-emulator failed: Permission denied
>
> Run the command x-terminal-emulator from a shell prompt.  What happens?
>
> Also, try these commands:
> ls -l $(which x-terminal-emulator)
> ls -l /etc/alternatives/x-terminal-emulator
>
>

It opens st, which is my default terminal emulator.

ls -l $(which x-terminal-emulator)
lrwxrwxrwx 1 root root 37 jun 17  2016 /usr/bin/x-terminal-emulator ->
/etc/alternatives/x-terminal-emulator

ls -l /etc/alternatives/x-terminal-emulator
lrwxrwxrwx 1 root root 11 jul 14  2019
/etc/alternatives/x-terminal-emulator -> /usr/bin/st



Re: [dev] [surf] can't follow a link for download

2020-02-20 Thread Greg Reagle
On Thu, Feb 20, 2020, at 08:26, Renato A. Galvão wrote:
> I use the packaged version buster (stable) of surf in Debian.
> 
> While trying to make any download I'm receiving this:
> 
> surf: execvp x-terminal-emulator failed: Permission denied

Run the command x-terminal-emulator from a shell prompt.  What happens?

Also, try these commands:
ls -l $(which x-terminal-emulator)
ls -l /etc/alternatives/x-terminal-emulator



Re: [dev] [surf] can't follow a link for download

2020-02-20 Thread Quentin Rameau
> Dear developers,

Hi Renato,

> I use the packaged version buster (stable) of surf in Debian.
> 
> While trying to make any download I'm receiving this:
> 
> surf: execvp x-terminal-emulator failed: Permission denied

This seems to be a Debian issue, surf uses "st" terminal emulator by
default, it seems that Debian packager(s) decided to replace that with
"x-terminal-emulator" which seems to be problematic on your system.

I suggest enquiring about that over-there!



[dev] [surf] can't follow a link for download

2020-02-20 Thread Renato A . Galvão
Dear developers,

I use the packaged version buster (stable) of surf in Debian.

While trying to make any download I'm receiving this:

surf: execvp x-terminal-emulator failed: Permission denied



Re: [dev] Surf backend

2020-01-26 Thread Teodoro Santoni
Hello,

2020-01-25 17:12 GMT, Hadrien Lacour :
> On Sat, Jan 25, 2020 at 05:20:19AM -0500, Jesse Limerick wrote:
>>   In regard to "replace webkit with something sane" from the TODO.md
>> fileincluded within surf.  I'm not sure if you all are aware of this:
>> https://github.com/SteveDeFacto/zsurf
>> Little abandoned project in the vein of surf, but using webengine
>> backend.
>>
>>   I'm a huge fan of Suckless.  Use dwm, dmenu, and st daily.  Webkit is
>> all that stops me from using surf.  I work in web development and sadly
>> most websites are optimised for use with webengine/blink.  I know
>> virtually nothing about C and such.  Yet I am easily able to configure
>> every suckless tool/utility. This is no doubt due to extensive
>> documentation and logical configuration.  It's also nice having
>> my config baked into the source code, as a fork. Versus having to
>> keep track of config files.  Nor do I have to worry about pacman
>> updating the software to be incompatible with my configurations.
>>
>>   Anyway, thought I'd float this out to you guys.  Might be a good
>> starting point for surf with a webengine backend.
>>
>> -Jesse Limerick
>>
>>
>
> I think you're lost, mate. If you want some hints about why: webkit's
> tar.xz is 20M while qtwebengine is 244M, one is made in C and useable in
> C while the other is a C++ only abomination requiring Qt.
> Don't misunderstand, though, Webkit is also horrible.
>
> The only suckless browser I can imagine is Netsurf, basically.
>
>

At least surf has the frontend to the webkit c++ nightmare in C,
albeit in Gtk/C.
Someone complained about netsurf too in this list, can't recall where,
because the parser is a function babel tower IIRC, complicates the
flow by using function calls instead of gotos. Didn't recall if that
was true either.
If someone wishes to make a surf on top of libns for X11, like the
browser Michael Forney made for wayland on his distro [1]...

[1] https://github.com/michaelforney/netsurf/tree/oasis/frontends/tiny

BR



Re: [dev] Surf backend

2020-01-25 Thread Hadrien Lacour
On Sat, Jan 25, 2020 at 06:22:18PM +0100, Quentin Rameau wrote:
> Hi Jesse, Hadrien,
>
> > >   In regard to "replace webkit with something sane" from the TODO.md
> > > fileincluded within surf.  I'm not sure if you all are aware of this:
> > > https://github.com/SteveDeFacto/zsurf
> > > Little abandoned project in the vein of surf, but using webengine
> > > backend.
> > >
> > >   I'm a huge fan of Suckless.  Use dwm, dmenu, and st daily.  Webkit is
> > > all that stops me from using surf.  I work in web development and sadly
> > > most websites are optimised for use with webengine/blink.  I know
> > > virtually nothing about C and such.  Yet I am easily able to configure
> > > every suckless tool/utility. This is no doubt due to extensive
> > > documentation and logical configuration.  It's also nice having
> > > my config baked into the source code, as a fork. Versus having to
> > > keep track of config files.  Nor do I have to worry about pacman
> > > updating the software to be incompatible with my configurations.
> > >
> > >   Anyway, thought I'd float this out to you guys.  Might be a good
> > > starting point for surf with a webengine backend.
> > >
> > > -Jesse Limerick
> > >
> > >
> >
> > I think you're lost, mate. If you want some hints about why: webkit's
> > tar.xz is 20M while qtwebengine is 244M, one is made in C and useable in
> > C while the other is a C++ only abomination requiring Qt.
> > Don't misunderstand, though, Webkit is also horrible.
>
> While webkit is C++ too, don't be naive about that, this is true that
> the GTK port wrapper is C and this is nicer to interface with it.
>
> I don't think that even if we wanted to interface with QtWebengine,
> it's possible to build it outside the whole Qt framework.
>
> There is little to no incentive from Google to make a good C API for
> interfacing with CEF/blink/whatever and even less for having a humanly
> bearable way to build it so not much in that way either.
>
> WebkitGTK is still the less sucky backend available, but it remains an
> ugly monster.
>

Sorry, I don't know why I thought even for a moment that Webkit was C.



Re: [dev] Surf backend

2020-01-25 Thread Quentin Rameau
Hi Jesse, Hadrien,

> >   In regard to "replace webkit with something sane" from the TODO.md
> > fileincluded within surf.  I'm not sure if you all are aware of this:
> > https://github.com/SteveDeFacto/zsurf
> > Little abandoned project in the vein of surf, but using webengine
> > backend.
> >
> >   I'm a huge fan of Suckless.  Use dwm, dmenu, and st daily.  Webkit is
> > all that stops me from using surf.  I work in web development and sadly
> > most websites are optimised for use with webengine/blink.  I know
> > virtually nothing about C and such.  Yet I am easily able to configure
> > every suckless tool/utility. This is no doubt due to extensive
> > documentation and logical configuration.  It's also nice having
> > my config baked into the source code, as a fork. Versus having to
> > keep track of config files.  Nor do I have to worry about pacman
> > updating the software to be incompatible with my configurations.
> >
> >   Anyway, thought I'd float this out to you guys.  Might be a good
> > starting point for surf with a webengine backend.
> >
> > -Jesse Limerick
> >
> >
> 
> I think you're lost, mate. If you want some hints about why: webkit's
> tar.xz is 20M while qtwebengine is 244M, one is made in C and useable in
> C while the other is a C++ only abomination requiring Qt.
> Don't misunderstand, though, Webkit is also horrible.

While webkit is C++ too, don't be naive about that, this is true that
the GTK port wrapper is C and this is nicer to interface with it.

I don't think that even if we wanted to interface with QtWebengine,
it's possible to build it outside the whole Qt framework.

There is little to no incentive from Google to make a good C API for
interfacing with CEF/blink/whatever and even less for having a humanly
bearable way to build it so not much in that way either.

WebkitGTK is still the less sucky backend available, but it remains an
ugly monster.



Re: [dev] Surf backend

2020-01-25 Thread Hadrien Lacour
On Sat, Jan 25, 2020 at 05:20:19AM -0500, Jesse Limerick wrote:
>   In regard to "replace webkit with something sane" from the TODO.md
> fileincluded within surf.  I'm not sure if you all are aware of this:
> https://github.com/SteveDeFacto/zsurf
> Little abandoned project in the vein of surf, but using webengine
> backend.
>
>   I'm a huge fan of Suckless.  Use dwm, dmenu, and st daily.  Webkit is
> all that stops me from using surf.  I work in web development and sadly
> most websites are optimised for use with webengine/blink.  I know
> virtually nothing about C and such.  Yet I am easily able to configure
> every suckless tool/utility. This is no doubt due to extensive
> documentation and logical configuration.  It's also nice having
> my config baked into the source code, as a fork. Versus having to
> keep track of config files.  Nor do I have to worry about pacman
> updating the software to be incompatible with my configurations.
>
>   Anyway, thought I'd float this out to you guys.  Might be a good
> starting point for surf with a webengine backend.
>
> -Jesse Limerick
>
>

I think you're lost, mate. If you want some hints about why: webkit's
tar.xz is 20M while qtwebengine is 244M, one is made in C and useable in
C while the other is a C++ only abomination requiring Qt.
Don't misunderstand, though, Webkit is also horrible.

The only suckless browser I can imagine is Netsurf, basically.



[dev] Surf backend

2020-01-25 Thread Jesse Limerick
  In regard to "replace webkit with something sane" from the TODO.md
fileincluded within surf.  I'm not sure if you all are aware of this:
https://github.com/SteveDeFacto/zsurf
Little abandoned project in the vein of surf, but using webengine
backend.

  I'm a huge fan of Suckless.  Use dwm, dmenu, and st daily.  Webkit is
all that stops me from using surf.  I work in web development and sadly
most websites are optimised for use with webengine/blink.  I know
virtually nothing about C and such.  Yet I am easily able to configure
every suckless tool/utility. This is no doubt due to extensive
documentation and logical configuration.  It's also nice having
my config baked into the source code, as a fork. Versus having to
keep track of config files.  Nor do I have to worry about pacman
updating the software to be incompatible with my configurations.

  Anyway, thought I'd float this out to you guys.  Might be a good
starting point for surf with a webengine backend.

-Jesse Limerick




[dev] [surf] Modal Patch Modification Help

2019-11-29 Thread Jason Blocklove
I'm trying to make the modal patch more complete so that you can't type
anything if not in insert mode, but I'm struggling to figure out how to
stop all keys that aren't hotkeys when insert is true. Anyone have any
ideas/has anyone done this?

Cheers,
Jason



Re: [dev] [surf] Zombies when forking

2019-09-17 Thread C.J. Wagenius
Thanks for info.

There's something messed up with my system. SIGCHLD is never caught. :(

/cjw


17 sep. 2019 17:08 av nullp...@gmx.net:

> On Tue, Sep 17, 2019 at 12:15:59PM +0200, C.J. Wagenius wrote:
>
>> Hi.
>>
>> I'm using surf on void linux (musl). I get a whole lot of zombies (sh 
>> ) when spawning child processes (Go & Find). I don't know where the 
>> optimal place is to put a waitpid for them but this works for me.
>>
>> # --- Start patch
>> index 2b54e3c..ef1309b 100644
>> --- a/surf.c
>> +++ b/surf.c
>> @@ -1327,6 +1327,7 @@ winevent(GtkWidget *w, GdkEvent *e, Client *c)
>> {
>>     int i;
>>
>> +   waitpid((pid_t)-1, NULL, WNOHANG);
>>     switch (e->type) {
>>     case GDK_ENTER_NOTIFY:
>>     c->overtitle = c->targeturi;
>> # --- End patch
>>
>> Thanks for awesome software.
>>
>> /cjw
>>
>
> You know, if no place in the code ever calls wait* except this line,
> might be simpler to just set SIGCHLD to SIG_IGN during initialization.
>
> Ciao,
> Markus
>




Re: [dev] [surf] Zombies when forking

2019-09-17 Thread Markus Wichmann
On Tue, Sep 17, 2019 at 12:15:59PM +0200, C.J. Wagenius wrote:
> Hi.
>
> I'm using surf on void linux (musl). I get a whole lot of zombies (sh 
> ) when spawning child processes (Go & Find). I don't know where the 
> optimal place is to put a waitpid for them but this works for me.
>
> # --- Start patch
> index 2b54e3c..ef1309b 100644
> --- a/surf.c
> +++ b/surf.c
> @@ -1327,6 +1327,7 @@ winevent(GtkWidget *w, GdkEvent *e, Client *c)
> {
>     int i;
>
> +   waitpid((pid_t)-1, NULL, WNOHANG);
>     switch (e->type) {
>     case GDK_ENTER_NOTIFY:
>     c->overtitle = c->targeturi;
> # --- End patch
>
> Thanks for awesome software.
>
> /cjw
>

You know, if no place in the code ever calls wait* except this line,
might be simpler to just set SIGCHLD to SIG_IGN during initialization.

Ciao,
Markus



[dev] [surf] Zombies when forking

2019-09-17 Thread C.J. Wagenius
Hi.

I'm using surf on void linux (musl). I get a whole lot of zombies (sh 
) when spawning child processes (Go & Find). I don't know where the 
optimal place is to put a waitpid for them but this works for me.

# --- Start patch
index 2b54e3c..ef1309b 100644
--- a/surf.c
+++ b/surf.c
@@ -1327,6 +1327,7 @@ winevent(GtkWidget *w, GdkEvent *e, Client *c)
{
    int i;

+   waitpid((pid_t)-1, NULL, WNOHANG);
    switch (e->type) {
    case GDK_ENTER_NOTIFY:
    c->overtitle = c->targeturi;
# --- End patch

Thanks for awesome software.

/cjw



[surf] "GitHub no longer supports old versions of Safari." (was: Re: [dev] [surf] FreeBSD GST_IS_GL_CONTEXT assertion failed)

2019-08-06 Thread Leonardo Taccari
Hello Jason,

Jason Smith writes:
> I tried with lots of FreeBSD setups there is bug related with surf or
> gstreamer. Playing youtube videos are not possible and there is "Please note 
> that GitHub no longer supports old versions of Safari." warning at 
> github.com. Here is output and screenshot.

At least regarding GitHub warning, spoofing the User-Agent: (e.g. to
the latest Firefox ESR) will workaround that issue (also other
webkit-gtk browsers IME has the same problem due that).



Re: [dev] [surf] FreeBSD GST_IS_GL_CONTEXT assertion failed

2019-08-06 Thread Jason Smith
I also attaching my gst-inspect output.
On 19/08/06 07:12PM, Jason Smith wrote:
> I tried with lots of FreeBSD setups there is bug related with surf or
> gstreamer. Playing youtube videos are not possible and there is "Please note 
> that GitHub no longer supports old versions of Safari." warning at 
> github.com. Here is output and screenshot.
>
>
> ** (:56477): CRITICAL **: 19:02:47.742: gst_gl_context_get_display: 
> assertion 'GST_IS_GL_CONTEXT (context)' failed
>
> ** (:56477): CRITICAL **: 19:02:47.742: 
> gst_gl_display_get_handle_type: assertion 'GST_IS_GL_DISPLAY (display)' failed
>
> (:56477): GStreamer-CRITICAL **: 19:02:47.752: gst_object_unref: 
> assertion 'object != NULL' failed
>
> (:56477): GStreamer-CRITICAL **: 19:02:47.752: gst_object_unref: 
> assertion 'object != NULL' failed
>
> ** (:56477): CRITICAL **: 19:02:47.752: gst_gl_context_get_display: 
> assertion 'GST_IS_GL_CONTEXT (context)' failed
>
> ** (:56477): CRITICAL **: 19:02:47.752: 
> gst_gl_display_get_handle_type: assertion 'GST_IS_GL_DISPLAY (display)' failed
>
> (:56477): GStreamer-CRITICAL **: 19:02:47.752: gst_object_unref: 
> assertion 'object != NULL' failed
>
> (:56477): GStreamer-CRITICAL **: 19:02:47.752: gst_object_unref: 
> assertion 'object != NULL' failed
>
> (:56477): GLib-GObject-WARNING **: 19:02:49.035: invalid
> uninstantiatable type '(null)' in cast to 'GstElement'
>
> (:56477): GStreamer-CRITICAL **: 19:02:49.035: 
> gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)'
> failed
>
> screenshot attached


equalizer:  equalizer-10bands: 10 Band Equalizer
equalizer:  equalizer-3bands: 3 Band Equalizer
equalizer:  equalizer-nbands: N Band Equalizer
efence:  efence: Electric Fence
alphacolor:  alphacolor: Alpha color filter
audiofx:  audioecho: Audio echo
audiofx:  audiofirfilter: Audio FIR filter
audiofx:  audiowsincband: Band pass & band reject filter
audiofx:  audiowsinclimit: Low pass & high pass filter
audiofx:  audioiirfilter: Audio IIR filter
audiofx:  audiochebband: Band pass & band reject filter
audiofx:  audiocheblimit: Low pass & high pass filter
audiofx:  audiodynamic: Dynamic range controller
audiofx:  audioamplify: Audio amplifier
audiofx:  audiokaraoke: AudioKaraoke
audiofx:  audioinvert: Audio inversion
audiofx:  audiopanorama: Stereo positioning
mulaw:  mulawdec: Mu Law audio decoder
mulaw:  mulawenc: Mu Law audio encoder
spectrum:  spectrum: Spectrum analyzer
flv:  flvmux: FLV muxer
flv:  flvdemux: FLV Demuxer
asf:  rtpasfdepay: RTP ASF packet depayloader
asf:  rtspwms: WMS RTSP Extension
asf:  asfdemux: ASF Demuxer
avi:  avisubtitle: Avi subtitle parser
avi:  avimux: Avi muxer
avi:  avidemux: Avi demuxer
y4menc:  y4menc: YUV4MPEG video encoder
goom2k1:  goom2k1: GOOM: what a GOOM! 2k1 edition
navigationtest:  navigationtest: Video navigation test
debug:  cpureport: CPU report
debug:  capsdebug: Caps debug
debug:  testsink: Test plugin
debug:  taginject: TagInject
debug:  progressreport: Progress report
debug:  pushfilesrc: Push File Source
debug:  navseek: Seek based on left-right arrows
debug:  rndbuffersize: Random buffer size
debug:  capssetter: CapsSetter
debug:  breakmydata: Break my data
realmedia:  pnmsrc: PNM packet receiver
realmedia:  rtspreal: RealMedia RTSP Extension
realmedia:  rdtmanager: RTP Decoder
realmedia:  rdtdepay: RDT packet parser
realmedia:  rademux: RealAudio Demuxer
realmedia:  rmdemux: RealMedia Demuxer
multipart:  multipartmux: Multipart muxer
multipart:  multipartdemux: Multipart demuxer
ossaudio:  osssink: Audio Sink (OSS)
ossaudio:  osssrc: Audio Source (OSS)
ossaudio:  ossmixer: OSS Mixer
goom:  goom: GOOM: what a GOOM!
audioparsers:  mpegaudioparse: MPEG1 Audio Parser
audioparsers:  flacparse: FLAC audio parser
audioparsers:  dcaparse: DTS Coherent Acoustics audio stream parser
audioparsers:  ac3parse: AC3 audio stream parser
audioparsers:  amrparse: AMR audio stream parser
audioparsers:  aacparse: AAC audio stream parser
dvdsub:  dvdsubparse: DVD subtitle parser
dvdsub:  dvdsubdec: DVD subtitle decoder
videomixer:  videomixer2: Video mixer 2
videomixer:  videomixer: Video mixer
dvdlpcmdec:  dvdlpcmdec: DVD LPCM Audio decoder
smpte:  smptealpha: SMPTE transitions
smpte:  smpte: SMPTE transitions
videofilter:  videoflip: Video flipper
videofilter:  videobalance: Video balance
videofilter:  gamma: Video gamma correction
flxdec:  flxdec: FLX video decoder
videocrop:  aspectratiocrop: aspectratiocrop
videocrop:  videocrop: Crop
ximagesrc:  ximagesrc: Ximage video source
mpegstream:  dvddemux: DVD Demuxer
mpegstream:  mpegdemux: MPEG Demuxer
mpegstream:  mpegparse: MPEG System Parser
shapewipe:  shapewipe: Shape Wipe transition filter
videobox:  videobox: Video box filter
wavparse:  wavparse: WAV audio demuxer
autodetect:  autoaudiosrc: Auto audio source
autodetect:  autoaudiosink: Auto audio sink
autodetect:  autovideosrc: Auto video source
autodetect:  autovideosink: Auto video sink
rtsp:  rtpdec: RTP Decoder
rtsp:  rtspsrc: RTSP packet 

[dev] [SURF] _SET_URI property doesn’t update on click

2019-07-14 Thread unwillexist
Tried with clean surf setup directly pulled from 
https://git.suckless.org/surf.


1-) GO youtube.com and check with xprop _SURF_URI(STRING) = 
"https://www.youtube.com/;


2-) click on any video and check xprop _SURF_URI(STRING) = 
"https://www.youtube.com/;


3-) Use mod+r to refresh page and check xprop _SURF_URI(STRING) = 
"https://www.youtube.com/watch;


Basically it doesn't update _SURF_URI when you click on video or any 
link unless you refresh page.




[dev] [surf] Keyboard Buttons for Surf

2019-07-14 Thread Kai Jewson
Hello,

Christian Hahn's easy links for surf is very outdated and doesn't work
anymore, so I wrote another version called keyboard buttons. It
provides several improvements/features:
- It adds the labels to the end of the DOM, to avoid messing with the
website's code
- It not only works for  elements, but also  elements
- It uses letters instead of numbers 1-5 so it is easier to reach
- modkey+r is a reserved combination for reloading the positions of the labels
- While holding down modkey, pressing escape cancels the current input

Other than that, it works the same as easy links. It also has a few
unavoidable flaws; sometimes the keyboard shortcuts used conflict with
the website's, a good example of that is that on Wikipedia alt+e is
used to start editing the page, but can also appear as a label. As a
workaround you can disable the use of the letter 'e' when generating
the labels, or you can automatically redirect to the mobile site of
Wikipedia which doesn't have keyboard shortcuts.

Regards,
Kai
/* keyboard buttons for surf */
/* Christian hahn  wrote the original code */

function
keyboardButtons()
{
const modKey  = "Alt"; /* used to initiate keyboardButtons mode */
const escKey  = "Escape"; /* used to escape keyboardButtons mode (you 
can also release alt) */
const labelStyle  = `
box-sizing: border-box;
position: absolute;
display: inline;
width: auto;
height: auto;
margin: 0;
z-index: 9;

padding: 2px;
border: 1px solid black;
border-radius: 0;

color: black;
font-size: 10px;
font-weight: normal;
font-family: sans-serif;
font-decoration: none;
text-transform: none;
`;
const normalColor= "yellow";
const highlightColor = "red";

var labels = {};
var input  = "";

function
updateLabelColor()
{
for (let id in labels) {
if (input && id.startsWith(input)) 
labels[id].elem.style.backgroundColor = highlightColor;
else   
labels[id].elem.style.backgroundColor = normalColor;
}
}

/* by default, this function chooses some sequence of letters, change it to 
what you like */
function
numberToLabel(n)
{
++n;
const alphabet = "abcdefghijklmnopqstuvwxyz";
/* r is removed as it reloads keyboardButtons */

var str = "";
for (;n; n = Math.floor(n/alphabet.length)) {
str += alphabet[n%alphabet.length];
}
return str;
}

function
Label(button, text)
{
this.button = button;

this.elem = document.createElement("span");
this.elem.innerHTML = text;
this.elem.style = labelStyle;
this.elem.style.visibility = "hidden";
const pos = this.button.getBoundingClientRect();
this.elem.style.left = pos.left + scrollX + "px";
this.elem.style.top  = pos.top  + scrollY + "px";
document.body.appendChild(this.elem);
}

function
createLabels()
{
for (let id in labels) 
labels[id].elem.parentNode.removeChild(labels[id].elem);
labels = {};

var buttons = Array.from(document.getElementsByTagName("a"))
  .concat(Array.from(document.getElementsByTagName("button")));
for (let i = 0; i < buttons.length; i++) {
const text = numberToLabel(i);
labels[text] = new Label(buttons[i], text);
}
updateLabelColor();
}

/* main */
createLabels();
/* set key handlers */
addEventListener("keydown", function (e) {
if (e.key === modKey) {
input = "";
for (let id in labels) labels[id].elem.style.visibility = "visible";
updateLabelColor();
} else if (e.getModifierState(modKey)) {
if (e.key === escKey || e.key === 'r') {
if (e.key === 'r') createLabels(); /* reload labels */
input = "";
for (let id in labels) labels[id].elem.style.visibility = 
"hidden";
} else if (e.key.length === 1) {
input += e.key;
}
updateLabelColor();
}
});
addEventListener("keyup", function (e) {
if (e.key === modKey) {
if (labels[input] !== undefined) {
labels[input].button.click();
}
input = "";
for (let id in labels) labels[id].elem.style.visibility = "hidden";
}
});
}

if (document.readyState === "complete") keyboardButtons();
else document.addEventListener("readystatechange", function (e) {
if (e.target.readyState === "complete") keyboardButtons();
});



Re: [dev] [surf] Surf not using http_proxy settings

2019-07-09 Thread Thomas Gardner
dev@suckless.org/2019-07-08 18:34:59+0200
> Surf-2.0 won't use the systemwide http_proxy and https_proxy

I noticed this happen in another context. The solution was to set
`all_proxy` instead. Perhaps that could help?





Re: [dev] [surf] Surf not using http_proxy settings

2019-07-08 Thread Leonardo Taccari
Hello Florian, 

Florian Fortner writes:
> [...]
> Surf-2.0 won't use the systemwide http_proxy and https_proxy environment
> variables which I want to use to run surf through tor. I tried with a 
> packaged version (void linux xbps repository), and a
> build from up-to-date source. 
>
> A "Peer failed to perform TLS handshake"
> error is shown.
>
> W3m for example works fine as it is, yet other webkit browsers show the
> same behaviour (Midori, etc.), unless setting
> the proxy in the browser settings. So it seems webkit2 does not respect the
> http_proxy setting?
>
> What could be the problem here? Is there a way to set the proxy setting for 
> webkit from within surf? 
>
> Any help is greatly appreciated!
> [...]

I often use it with mitmproxy and just setting the http_proxy
(e.g. `http_proxy=http://localhost:8080') environment variable
works at least with current surf Git HEAD.

What are the values of http_proxy and https_proxy environment?



[dev] [surf] Surf not using http_proxy settings

2019-07-08 Thread Florian Fortner
Hi,

Surf-2.0 won't use the systemwide http_proxy and https_proxy environment
variables which I want to use to run surf through tor. I tried with a packaged 
version (void linux xbps repository), and a
build from up-to-date source. 

A "Peer failed to perform TLS handshake"
error is shown.

W3m for example works fine as it is, yet other webkit browsers show the
same behaviour (Midori, etc.), unless setting
the proxy in the browser settings. So it seems webkit2 does not respect the
http_proxy setting?

What could be the problem here? Is there a way to set the proxy setting for 
webkit from within surf? 

Any help is greatly appreciated!

Regards,

Florian



Re: [dev] [surf] unveil

2019-05-04 Thread Thomas Levine
Please send your port/patch. Maybe I will try it.

On Sat, May 4, 2019, at 12:04, Thuban wrote:
> Hi,
> Is there any OpenBSD user who have already unveiled surf?
> 
> I'm trying to, but I keep having an error about "Can't open display".
> -- 
> thuban
> 
>



[dev] [surf] unveil

2019-05-04 Thread Thuban
Hi,
Is there any OpenBSD user who have already unveiled surf?

I'm trying to, but I keep having an error about "Can't open display".
-- 
thuban



Re: [dev] [surf] scroll not working

2019-04-17 Thread Szpak

Is it me only or scroll stopped working after 7ea0c2f?


Maybe something to include in the git master?


My fault; it works just fine. I was running surf in workdir but apparently  
`make install` was necessary to update web extension dir.


s/



Re: [dev] [surf] scroll not working

2019-04-15 Thread Jochen Sprickerhof

Hi Szpak,

* Szpak  [2019-04-15 14:12]:

Is it me only or scroll stopped working after 7ea0c2f?


Not sure about the sha1 but I have the attached patch to fix this.
Maybe something to include in the git master?

Cheers Jochen
From 01148684fb65a434c7c5d36251d6bc414dfb1711 Mon Sep 17 00:00:00 2001
From: Jochen Sprickerhof 
Date: Fri, 12 Oct 2018 21:46:50 +0200
Subject: [PATCH] Scroll using js

As peer https://stackoverflow.com/a/21861770, all other methods are
deprecated.
---
 config.def.h | 12 ++--
 surf.c   |  7 +++
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/config.def.h b/config.def.h
index 34265f6..20977db 100644
--- a/config.def.h
+++ b/config.def.h
@@ -144,12 +144,12 @@ static Key keys[] = {
 	{ MODKEY,GDK_KEY_h,  navigate,   { .i = -1 } },
 
 	/* vertical and horizontal scrolling, in viewport percentage */
-	{ MODKEY,GDK_KEY_j,  scrollv,{ .i = +10 } },
-	{ MODKEY,GDK_KEY_k,  scrollv,{ .i = -10 } },
-	{ MODKEY,GDK_KEY_space,  scrollv,{ .i = +50 } },
-	{ MODKEY,GDK_KEY_b,  scrollv,{ .i = -50 } },
-	{ MODKEY,GDK_KEY_i,  scrollh,{ .i = +10 } },
-	{ MODKEY,GDK_KEY_u,  scrollh,{ .i = -10 } },
+	{ MODKEY,GDK_KEY_j,  eval,   { .v = "window.scrollBy(0, +10);" } },
+	{ MODKEY,GDK_KEY_k,  eval,   { .v = "window.scrollBy(0, -10);" } },
+	{ MODKEY,GDK_KEY_space,  eval,   { .v = "window.scrollBy(0, +window.innerHeight);" } },
+	{ MODKEY,GDK_KEY_b,  eval,   { .v = "window.scrollBy(0, -window.innerHeight);" } },
+	{ MODKEY,GDK_KEY_i,  eval,   { .v = "window.scrollBy(+10, 0);" } },
+	{ MODKEY,GDK_KEY_u,  eval,   { .v = "window.scrollBy(-10, 0);" } },
 
 
 	{ MODKEY|GDK_SHIFT_MASK, GDK_KEY_j,  zoom,   { .i = -1 } },
diff --git a/surf.c b/surf.c
index 2b54e3c..0923688 100644
--- a/surf.c
+++ b/surf.c
@@ -167,6 +167,7 @@ static void setcert(Client *c, const char *file);
 static const char *getstyle(const char *uri);
 static void setstyle(Client *c, const char *file);
 static void runscript(Client *c);
+static void eval(Client *c, const Arg *arg);
 static void evalscript(Client *c, const char *jsstr, ...);
 static void updatewinid(Client *c);
 static void handleplumb(Client *c, const char *uri);
@@ -950,6 +951,12 @@ runscript(Client *c)
 	g_free(script);
 }
 
+void
+eval(Client *c, const Arg *arg)
+{
+	evalscript(c, arg->v, "");
+}
+
 void
 evalscript(Client *c, const char *jsstr, ...)
 {
-- 
2.20.1



signature.asc
Description: PGP signature


[dev] [surf] scroll not working

2019-04-15 Thread Szpak

Is it me only or scroll stopped working after 7ea0c2f?

sZpak



Re: [dev] [surf] Bug: _SURF_URI and _SURF_GO sometimes won't update

2019-03-01 Thread nzl
This is a bug of surf, it usually happens when browsing some js heavy sites, I 
have something
like the following in my custom version of surf, and it solved the problem.

commit 9280cffc390e79416487d23f6cbca96fb80fc0da
Author: nzl 
Date:   Fri Jan 18 06:44:30 2019 +

signal uri change

diff --git a/surf.c b/surf.c
index 5c8cb4e..fd7223c 100644
--- a/surf.c
+++ b/surf.c
@@ -175,6 +175,7 @@ static gboolean loadfailedtls(WebKitWebView *v, gchar *uri,
 static void loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client *c);
 static void progresschanged(WebKitWebView *v, GParamSpec *ps, Client *c);
 static void titlechanged(WebKitWebView *view, GParamSpec *ps, Client *c);
+static void urichanged(WebKitWebView *view, GParamSpec *ps, Client *c);
 static void mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h,
guint modifiers, Client *c);
 static gboolean permissionrequested(WebKitWebView *v,
@@ -531,6 +532,8 @@ newclient(void)
 G_CALLBACK(progresschanged), c);
g_signal_connect(G_OBJECT(v), "notify::title",
 G_CALLBACK(titlechanged), c);
+   g_signal_connect(G_OBJECT(v), "notify::uri",
+G_CALLBACK(urichanged), c);
g_signal_connect(G_OBJECT(v), "button-release-event",
 G_CALLBACK(buttonreleased), c);
g_signal_connect(G_OBJECT(v), "close",
@@ -591,8 +594,6 @@ loaduri(Client *c, const char *uri)
free(apath);
}
 
-   setatom(c, AtomUri, url);
-
if (strcmp(url, geturi(c)) == 0) {
a.i = 0;
reload(c, );
@@ -600,9 +601,7 @@ loaduri(Client *c, const char *uri)
if (!useragent)
randuseragent(c);
webkit_web_view_load_uri(c->view, url);
-   updatetitle(c);
}
-
g_free(url);
 }
 
@@ -1159,7 +1158,7 @@ loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client 
*c)
 
switch (e) {
case WEBKIT_LOAD_STARTED:
-   setatom(c, AtomUri, uri);
+   c->overtitle = NULL;
c->title = uri;
c->https = c->insecure = 0;
seturiparameters(c, uri, loadtransient);
@@ -1169,7 +1168,7 @@ loadchanged(WebKitWebView *v, WebKitLoadEvent e, Client 
*c)
g_clear_object(>failedcert);
break;
case WEBKIT_LOAD_REDIRECTED:
-   setatom(c, AtomUri, uri);
+   c->overtitle = NULL;
c->title = uri;
seturiparameters(c, uri, loadtransient);
break;
@@ -1200,6 +1199,12 @@ titlechanged(WebKitWebView *view, GParamSpec *ps, Client 
*c)
updatetitle(c);
 }
 
+void
+urichanged(WebKitWebView *view, GParamSpec *ps, Client *c)
+{
+   setatom(c, AtomUri, geturi(c));
+}
+
 void
 mousetargetchanged(WebKitWebView *v, WebKitHitTestResult *h, guint modifiers,
 Client *c)




Re: [dev] [surf] Bug: _SURF_URI and _SURF_GO sometimes won't update

2019-02-27 Thread Nick
Quoth Szpak: 
> It's not very often so I don't worry much about that, but I have a feeling
> that (at least on my machine) it's related to:
> 1. using proxy (privoxy or squid in my case);
> 2. unfinished page loading, which stops at some percent before 100, like 89%
> or even 40%;
> 
> The problem number 2 was already discussed here on suckless list a while ago
> but I cannot find it now. Maybe someone else can confirm that it's related
> or not.

FYI that was my post, thread starts here: 
http://lists.suckless.org/dev/1803/32607.html

I don't know if it's related to the OP's issue or not.



Re: [dev] [surf] Bug: _SURF_URI and _SURF_GO sometimes won't update

2019-02-27 Thread Szpak

Hi Suleiman,

I can't reproduce your problem just like that (google.de → search →  
redirection → copy/bookmark url). So mostly it works just fine, but  
sometimes I notice similar behavior, which is incorrect url after  
redirection (from duckduckgo in my case).


It's not very often so I don't worry much about that, but I have a feeling  
that (at least on my machine) it's related to:

1. using proxy (privoxy or squid in my case);
2. unfinished page loading, which stops at some percent before 100, like  
89% or even 40%;


The problem number 2 was already discussed here on suckless list a while  
ago but I cannot find it now. Maybe someone else can confirm that it's  
related or not.


Meanwhile try to reproduce bug without proxy (if you use any) and make  
sure that your surf sources are the latest one.


sZpak



[dev] [surf] Bug: _SURF_URI and _SURF_GO sometimes won't update

2019-02-25 Thread Suleiman Sulo



Hi,
 
I am a gentoo user and have some problems getting bookmarks stored.
This is not a patch/script problem and I can show you how to produce this bug.
 
I open google.de and search for any thing. Then I use the mouse to click on the 
link to open the link.
After this procedure the _SURF_URI variable is still a google related address.
 
For example, when I search with google for gentoo forums and then click on the 
link with the mouse the site opens, but _SURF_URI won't update.
Here the oputput with xprop ...
 
_SURF_GO(STRING) = "google.de"
_NET_WM_USER_TIME(CARDINAL) = 11559044
_NET_WM_ICON_GEOMETRY(CARDINAL) = 2981, 394, 150, 30
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
_NET_FRAME_EXTENTS(CARDINAL) = 3, 3, 3, 3
_NET_WM_STATE(ATOM) =
_NET_WM_DESKTOP(CARDINAL) = 0
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                window id # of group leader: 0x1e1
_SURF_URI(STRING) = 
"https://www.google.de/search?source=hp=Ejp0XPyJHMPhmwXm5qTgCA=forums+gentoo=Google-Suche=forums+gentoo_l=psy-ab.3..0i19j0i30i19.5406.15090..15231...5.0..0.127.1677.18j1..01..gws-wiz.0..0i131j0j0i10j0i22i30i19.ei4coFdD5DA[https://deref-gmx.net/mail/client/OrTqC1saa0U/dereferrer/?redirectUrl=https%3A%2F%2Fwww.google.de%2Fsearch%3Fsource%3Dhp%26ei%3DEjp0XPyJHMPhmwXm5qTgCA%26q%3Dforums%2Bgentoo%26btnK%3DGoogle-Suche%26oq%3Dforums%2Bgentoo%26gs_l%3Dpsy-ab.3..0i19j0i30i19.5406.15090..15231...5.0..0.127.1677.18j1..01..gws-wiz.0..0i131j0j0i10j0i22i30i19.ei4coFdD5DA];
_SURF_FIND(STRING) = ""
_GTK_THEME_VARIANT(UTF8_STRING) =
XdndAware(ATOM) = BITMAP
_NET_WM_OPAQUE_REGION(CARDINAL) = 7, 0, 1692, 7, 0, 7, 1706, 1383
WM_WINDOW_ROLE(STRING) = "Surf[1]"
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 31457285, 31457286
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x1e4
WM_CLIENT_LEADER(WINDOW): window id # 0x1e1
_NET_WM_PID(CARDINAL) = 13918
WM_LOCALE_NAME(STRING) = "de_DE.utf8"
WM_CLIENT_MACHINE(STRING) = "mypc"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified minimum size: 0 by 0
                program specified base size: 0 by 0
                window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, 
_NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "surf", "Surf"
WM_ICON_NAME(STRING) = "@cgDISVMf:T | Gentoo Forums :: Index"
_NET_WM_ICON_NAME(UTF8_STRING) = "@cgDISVMf:T | Gentoo Forums :: Index"
WM_NAME(STRING) = "@cgDISVMf:T | Gentoo Forums :: Index"
_NET_WM_NAME(UTF8_STRING) = "@cgDISVMf:T | Gentoo Forums :: Index"
 
 
As you can see the WM_ICON_NAME is "Gentoo Forums :: Index" but the _SURF_URI 
and _SURF_GO are still from google.
This problem I can reproduce with any site, it doesn't have to be a gentoo 
related site.
I haven't tested much but it seems to be related with google.
I also can use the keyboard to surf sites, this bug will still occure when 
searching for  a website with google.
 
I reconized the problem when adding bookmarks, and instead I always store the 
google search string.
This happen to me with two different computers.
 
Here is the surf version I have installed ...
www-client/surf-2.0:0
net-libs/webkit-gtk-2.22.6:4/37
 
I tried several scripts and patches to fix this, but none of them worked.
BTW.  when using ctrl+y surf stores the correct address in clipboard but 
_SURF_URI and _SURF_GO still won't update.
 
Hope you can help me get bookmarks stored with the expected address.
 
 



Re: [dev] surf

2019-01-28 Thread David Demelier

Le 26/01/2019 à 22:33, Igor Rubel a écrit :

Unfortunately, it seems that XQuartz doesn't support Retina displays properly.


X does not perform any kind of scaling on its own. It's the purpose of 
toolkiks to do that. For example with Gtk applications one should set 
the environment variable GDK_SCALE=2 (at least) to scale 2 times.


Try: GDK_SCALE=2 surf

HTH

--
david



Re: [dev] surf

2019-01-26 Thread Igor Rubel
Yeah, that is the problem. Thanks!

Unfortunately, it seems that XQuartz doesn't support Retina displays properly.

> On 26. Jan 2019, at 21:08, Greg Reagle  wrote:
> 
> On Sat, Jan 26, 2019, at 15:58, Igor Rubel wrote:
>> I've just installed surf using MacPorts.
>> 
>>> surf https://www.apple.com/
>>> Can't open default display
>> 
>> How can one solve that?
> 
> Hi.  My guess, and it is just a wild guess because I don't even own an 
> Apple/Mac (although I have used them at work before), is that surf is 
> expecting an X server and that you are not running an X server.  My 
> understanding is that MacOS's native/default display system in not X11.  The 
> solution would be to install and run an X server.
> 




Re: [dev] surf

2019-01-26 Thread Greg Reagle
On Sat, Jan 26, 2019, at 15:58, Igor Rubel wrote:
> I've just installed surf using MacPorts.
> 
> > surf https://www.apple.com/
> > Can't open default display
> 
> How can one solve that?

Hi.  My guess, and it is just a wild guess because I don't even own an 
Apple/Mac (although I have used them at work before), is that surf is expecting 
an X server and that you are not running an X server.  My understanding is that 
MacOS's native/default display system in not X11.  The solution would be to 
install and run an X server.



  1   2   3   4   5   6   7   8   9   10   >