Code Monkey home page Code Monkey logo

surfer's Introduction

Surfer

Simple keyboard based web browser. No tabs.

Based on webkit2gtk and gtk3.

No xlibs dependency — works on sway, weston etc.

Look also at manual ( man surfer).

Adblock, videos, other info

For videos install gstreamer packages.

config.h - customize keys, dirs and some other settings before compile.

It can also launch mpv( with help of youtube-dl on supported sites) on links, but remember to pkill -9 mpv if it hogs your cpu, used on non supported sites.

Also possible to use other binaries/scripts - location of dirctory of that settable in config.h

Beside it can toggle JS and History. Ephemeral (priv mode) on links. You can also set css for sites in .surfer/tablecss.txt file.

Search or translate for selected text, settable in config.h

For adblock:

Install https://github.com/jun7/wyebadblock Then sudo ln -s /usr/lib/wyebrowser/adblock.so /usr/lib/surfer

Or block through /etc/hosts

Or save to .surfer/adblock.json file (ie from https://easylist-downloads.adblockplus.org/easylist_min_content_blocker.json )

For JS scripts:

Js scripts (i.e. from greasefork site) place in .local/share/surfer/

name them in following way: -i.e. for run scripts on www.youtube.com name script file identically. -if you want script to run on all sites, name it universal.js

Compile and install:

git clone https://github.com/nihilowy/surfer.git

cd surfer

make && sudo make install

Depends on webkit2gtk, gtk3 development files (install it on your distro)

Hotkeys:

Ctrl + click link — open link in new window

Ctrl + n — new window

Ctrl + b — go back

Ctrl + f — go forward

Ctrl + q — quit

Esc — stop loading

Ctrl + h — home (bookmarks list)

Ctrl + shift + b — bookmark site (to remove just edit file with links: bookmarks in your SURFER_DIR dir)

Ctrl + o — toggle url bar

Ctrl + / — find word

Ctrl + r — reload page

Ctrl + = — zoom in

Ctrl + - — zoom out

Down Arrow — scroll down

Up arrow — scroll up

Ctrl + w — page up

Ctrl + s — page down

Ctrl + Shift + i — web inspector (page source)

Ctrl + Shift + s — toggle user style black theme (/usr/share/surfer/black.css)

Ctrl + Shift + h — show history if enabled

F11 — toggle fullscreen

Edit config.h to change hotkeys and SURFER_DIR, SURFER_DOWNLOADS, and other settings

surfer's People

Contributors

av-src avatar nihilowy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

surfer's Issues

so, i got this idea last night, this might help you

see i don't know how easy it is to do because i'm not a programmer
but here is my idea

instead of editing the main surfer.c file to add new features
you could keep the surfer.c clean with only basic things

and for each feature you create a new small .c file

making it easier to maintain

and i saw this from the wine-tkg
you could make the make file read a txt file from the surfer folder for example
and in this txt file the user can specify what features he want enabled and disabled during the compilation

thing1 = on
thing2 = on
thing3 = off

this way the files will survive "git pull"
and also possible to change the PKGBUILD file to compile only what the user wants from the browser

so in the future you can work more in the small .c file to fix or enhance any feature
instead of having to edit the main surfer .c

and i think the idea of being able to disable something in the browser could be a feature of surfer
like, if the user don't like something he can just disable it from the compilation

wazzup man

yo man, what are the news?

i haven't been using surfer for somedays
i'll try again, i hope the problem with the videos is gone now
yeah videos and gifs are still broken

i tried to use sway but got so many problems with the configuration that i just gave up

and about learning C
i'm not going good, i don't understand
i think i am starting wrong
how should i start learning C?

poor video performance

particularly 4k 60fps youtube barely works at all (perfectly smooth for me in other browsers, although epiphany seems unhappy about resizing videos while playing...)

Can't show page before it's fully loaded

Currently it seems like it waits for all resources to finish loading before showing the page. This makes it e.g. take ages when accessing wikipedia.org, which really should not take that long to show. Perhaps there could be some configuration option to make it show the page instantly without waiting for the assets to load?

Makefile: needs fix for packaging

Hello,
I am unable to package surfer with the provided Makefile because DESTDIR and INSTALLDIR are used.
Why not just use DESTDIR ?
However I can use a simple sed to fix this.
Greetings

sorry I closed last issue

I have headache , and dont feel very well .
you can comment here if you wont or even send scripts /patches :))

javascript crashes

on some sites like google js crashes happens . Probably putting these to .bashrc helps

export JavaScriptCoreUseJIT=0
export JSC_useBaselineJIT=false

More Updates

i think you should close the other ones

ok , this time
the videos are still broken
but i can use mpv

i think you should change "(null)" to "surfer"
when i open surfer the title of the window is "(null)"
listing the bookmarks
if i open any page and hit "ctrl + h" i will go to the bookmarks page but the window will have no title
i think this might be easy to do by just changing the <title></title> in the html file

just add <title>something here</title> in the html file

also i'm learning C
so, maybe in 10 years i can help this project for real

Compile error

platform: archlinux-amd64

==> Starting build()...
cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wno-deprecated-declarations -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o surfer surfer.c
pkg-config --cflags --libs libnotify gtk+-3.0 glib-2.0 webkit2gtk-4.0
-DEXTENSION_DIR="/usr/lib/surfer/"
-DDEBUG=0 -lm
surfer.c: In function ‘permission_request_cb’:
surfer.c:652:49: error: format not a string literal and no format arguments [-Werror=format-security]
652 | msg);
| ^~~
In file included from /usr/include/glib-2.0/glib.h:62,
from /usr/include/gtk-3.0/gdk/gdkconfig.h:8,
from /usr/include/gtk-3.0/gdk/gdk.h:30,
from surfer.c:25:
surfer.c: In function ‘png_finished’:
surfer.c:1611:18: warning: format ‘%s’ expects argument of type ‘char *’, but argument 4 has type ‘GError *’ {aka ‘struct _GError *’} [-Wformat=]
1611 | g_error( "error creating snapshot: %s",error );
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~
| |
| GError * {aka struct _GError *}
/usr/include/glib-2.0/glib/gmessages.h:337:32: note: in definition of macro ‘g_error’
337 | VA_ARGS);
| ^~~~~~~~~~~
surfer.c:1611:45: note: format string is defined here
1611 | g_error( "error creating snapshot: %s",error );
| ~^
| |
| char *
cc1: some warnings being treated as errors
make: *** [Makefile:18: surfer] Error 1
==> ERROR: A failure occurred in build().
Aborting...
error: failed to build 'surfer-git-4-0':
error: packages failed to build: surfer-git-4-0

now its really a issue

so yeah
i was using discord on surfer
but when i clicked in the gif icon and the tenor thing loaded
the cpu usage went crazy, the fan started spinning super fast and the entire system got slow
this doesn't happen in surf or epiphany
so something very serious is happening here
when surfer tries to load the tenor page with a bunch of gifs

Remove some unnecessary options

i think its better to remove these

#define SURFER_TMPDOWNLOADS "/tmp"
#define SURFER_PLAYER "mpv"

for /tmp the browser already asks where to save the file
so its ok

and SURFER_PLAYER can easily be done with a simple script in dmenu

so you could do like that
instead of opening a link with mpv
you could change it to
"open link with"

and the user could decide what programs go into the list of "open link with"
like
mpv, vlc, audacious, mocp

Downloads?

Hey,

I love Suckless Surf, so found this work. Thanks a lot for creating it!

I was wondering - if it currently implements support for downloading attachments ?

I went through the code, saw lots of disabled lines. Just wanted to ask here.

Cheers
Azer

Buffer overflow

Since commit 6e22c33 surfer refuses to start with a "bufferoverflow" on my musl based linux.

Icon

I made an icon In Blender 3D
see if you like
Icons.zip

yeah 8x8 too lol
also close the other issues

or just use this one
and you do the resizing
out

some updates

the browser is working great
still feels some stuttering over time
maybe the problem wasn't web-gl?

things that would be great are
notifications

be able to copy and paste images
right now "copy image" and "copy image address" do just the same thing
and its not possible to paste images
i have to drag from the file manager to the window
if i try to open the file manager to find a image i can't see the preview
so dragging the file is the best way right now

change black.css to style.css ( would make more sense )
and change " ctrl + / " to " ctrl + \ " ( they are near each other)

have a better way to show the loading progress
if the window is maximized, make the browser show a line with the text of the percentage of the page loading, and it disappears when it reaches 100%
the user can click in the line to make it disappear or disable it in the surfer.c file

maybe last thing for the future
but you could implement a configuration file
instead of having to edit the surfer.c
the user could just edit a config file with the options he wants
and this would also help you to make the code cleaner

wazup john

i have been using surfer a lot
thinking what browser i should use as my main browser
tired of firefox
and Epiphany is horrible, god dammit i'm hating this browser, just keeps crashing and the "features" are really gnome like

got no idea what you could add to surfer
but its really good
good work

u up?

so yeah i wanted to ask for more stuff

first, if you could add an indicator in the name of the window of how much the page has loaded
like
loading "[33%] GitHub - Mozilla Firefox"
and after loading "GitHub - Mozilla Firefox"
(firefox as example)

second, an option to disable or change the way the browser handles the cookies
#define SURFER_COOKIE_POLICY WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS

to something like
always = accept all cookies
no third-party = do not accept third-party cookies and cookies from unvisited sites
disabled = do not accept cookies

3rst, i think this one might be really hard to add
but i ask if you could add an option to choose where the user want to save a file
instead of saving it to "downloads", i know its faster
but i think its better to be asked where i want to save the file
for example, i like to save some images in /tmp, because its just some meme that i want to send to someone, the image will be deleted when i restart my computer

just that
everything else in surfer is awesome, i'm loving it
keep the awesome work

Pull Request(s)?

Hey @nihilowy!

I've been working with your project and started a small personal fork, but I want to check in and see whether you'd accept any of my changes. Here's a small list of my changes:

  • Remove extra whitespace
  • .gitignore
  • Makefile:
    • Removed commented-out code
    • Replace $INSTALLDIR with $DESTDIR
  • PKGBUILD: install to $pkgdir/opt
  • surfer.c:
    • Use consistent indentation
    • Replace Ctrl+O with Ctrl+L
    • Remove commented-out code
  • surfer.desktop: Replace "Web" with "Surfer"
  • README.md`:
    • Use pure Markdown, no HTML.
    • Capitalization, formatting, and serial comma.

You can also view my code at https://github.com/christianbundy/surfer. Please let me know whether you'd like any PRs, or whether I should continue just using my personal fork. Thanks for your work on this project!

need some informations

can i change where the style sheet will be by just changing
#define USER_STYLESHEET_FILENAME "/usr/share/surfer/black.css" ?
or the program will always search in "/usr/share/surfer/black.css" ?

same for
#define WEB_EXTENSIONS_DIRECTORY "/usr/lib/surfer"

and i want to change where .fav and .hist are saved

hmm
also can you add a -h or --help option to show the keys configured in the browser?

aye your browser works very well
much batter than surf in my opinion

but i can't use tabbed
you have any idea how to use surfer in tabbed?

editing again
surfer isn't using /etc/hosts for some reason
it works in other browsers but not in surfer

and .css files
can i only use one .css file?

i want to use one for ads
and other for colors , but i think i can just make one with everything i need

Makefile installation not correct.

installation with make is set to install to $(DESDIR)/usr/...

this makes it so that i cant install to /usr/local because if i set DESTDIR=/usr/local , then it will install to /usr/local/usr/bin/surfer.

simply removing the /usr from the installation locations would allow it to work.

adding DESTDIR := $(if $(DESTDIR),$(DESTDIR),/usr) would allow the same default install location.

man asks more questions

i was thinking about using surfer for web development
you think its possible to have live update on surfer?
to see the page changing while i edit it
and a option to save the file or files

maybe this is already possible and i just don't know how
i'm talking about using the web inspector

asking more questions

yo thank you very much for the change to use .surfer
now i was thinking

its possible to make the style be always used?
i'm using this one to hide ads
http://floppymoose.com/

works very well for surf and surfer
but having to enable it every time is annoying
so i ask if you could add an option to always use the style

change to something like
always use the file in ".surfer/style.css"

and hit Ctrl + Shift + s to disable it
would make more sense, if someone already have the file in the folder its because he wants to use it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.