UZBL browser, UZBL scripts, UZBL complete

Forum Forums General Software UZBL browser, UZBL scripts, UZBL complete

  • This topic has 20 replies, 3 voices, and was last updated Jan 25-5:16 pm by BobC.
Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #5567
    Member
    koolstofje

      UZBL-browser scripts in antiX-17 Debian Stretch

      It’s my very first scripts isju..

      Ok I changed some ‘keyboard shortcuts’ in UZBL script1_config
      so i can stay most on a close aria on the keyboard

      (but you can change everything in that script1_config file)

      o= follow by number
      ‘= follow by text
      0= open url
      ,= scroll vertical 450
      .= scroll -vertical -450
      l= go back
      a= go forward
      g= load bookmarks
      h= load history
      ]]= go next page
      [[= go prev pag
      1= zoom 100%
      2= zoom 120%
      3= zoom 135%
      4= zoom 200%
      5= zoom 235%
      += zoom +
      -= zoom –
      z= toggle zoom type
      t= toggle show status
      y= toggle show tablist
      b= new tab
      n= next tab
      m= prev tab
      q= close tab

      A enter= antixforum.com πŸ™‚
      G enter= google.com
      Y enter= youtube.com
      f enter= facebook.com

      Facebook shortcuts

      Shift + i= activate the keys

      j= block down
      k= block up
      l= like
      o= open picture
      β†’= next picture
      ←= prev picture

      Esc= stop facebook shortcuts
      ____________________________________

      Here the necessary things to do on UZBL, so that everything works in UZBL

      Do the things step by step, safe and see if it works !!
      At each script copy the original script as backup !!

      Here we go…….:)

      1
      Install uzbl,

      sudo apt update
      sudo apt install uzbl

      2
      Install gstreamer,

      sudo apt update
      sudo apt install gstreamer1.0*

      or

      3
      Install youtube-dl,

      sudo apt update
      sudo apt install uzbl suckless-tools youtube-dl

      4
      Install firejail,

      sudo apt update
      sudo apt install firejail

      5
      Install tabbed,

      sudo apt update
      cd /usr/bin
      sudo ln -fsT uzbl-tabbed uzbl

      6
      Install Polipo,

      sudo apt update
      sudo apt install polipo

      add to autostart,

      polipo &
      mkdir ~/.polipo-cache
      sudo cp /etc/polipo/config /etc/polipo/config.orig
      sudo nano /etc/polipo/config
      diskCacheRoot = “~/.polipo-cache/”

      Restart polipo,

      sudo /etc/init.d/polipo restart

      7
      Put the ‘attachment script1_config’ and replay 2/3/4/5/6/7/8 scripts .. as root on the right place

      ______________________________________

      Everything in UZBL works on my antiX-17 computer now.

      I hope it will works on your computer ..

      Do you like it, ok .. if not, or do you know better, change scripts and let it hear πŸ™‚

      • This topic was modified 5 years, 3 months ago by koolstofje.
      • This topic was modified 5 years, 3 months ago by koolstofje.
      • This topic was modified 5 years, 3 months ago by koolstofje.
      Attachments:
      #5569
      Member
      koolstofje
        Helpful
        Up
        0
        ::

        Script 2
        style.css,

        My UZBl vim ‘highlights script’

        Give it the name, style.css
        Put it in .config.uzbl/style.css

        ☟

        #uzbl_link_hints > span {
        z-index: 1000 !important;

        background-color: #111 !important;
        margin: 0 !important;
        padding: 3px !important;

        color: #BFFF00 !important;
        font-size: 10px !important;
        line-height: 14px !important;
        font-weight: bold !important;
        font-variant: normal !important;
        text-decoration: none !important;

        -webkit-transform: translate(-5px,-5px);
        opacity: 0.8;
        -webkit-border-radius: 6px !important;
        /* Play around with this, pretty fun things to do πŸ™‚ */
        /* -webkit-transform: scale(1) rotate(0deg) translate(-6px,-5px) !important; */
        }

        /* we can have different colours for different types of hints! */
        #uzbl_link_hints.new-window > span {
        background-color: #ffff00 !important;
        color: black !important;
        }

        .uzbl-follow-text-match {
        outline: px solid invert;
        background: #000 !important;
        color: yellow !important; ‘Esc’)
        }

        /* vim:set et ts=4: */

        • This reply was modified 5 years, 3 months ago by koolstofje.
        • This reply was modified 5 years, 3 months ago by koolstofje.
        • This reply was modified 5 years, 3 months ago by koolstofje.
        #5580
        Member
        koolstofje
          Helpful
          Up
          0
          ::

          Script 3
          download,

          Give it the name, download.sh
          Put it in, /usr/share/uzbl/examples/scripts

          ☟

          #!/bin/sh
          # uzbl’s example configuration sets this script up as its download_handler.
          # this script is run when uzbl encounters a URL that it can’t display, and when
          # a download is requested using the ‘download’ command.
          #
          # if the script prints a file path to stdout, uzbl will save the download to
          # that path using it’s internal downloader.
          #
          # if nothing is printed to stdout, the internal download will be cancelled.
          # you could do your own download handling in your script that way.

          # if $5 is set, it is the path that was passed to uzbl’s “download” command.
          # we want to use that if it’s available.
          [ -n “$5” ] && echo “$5” && exit

          . “$UZBL_UTIL_DIR/uzbl-dir.sh”

          # the URL that is being downloaded
          uri=”$1″
          shift

          safe_uri=”$( echo “$uri” | sed -e ‘s/\W/-/g’ )”

          # a filename suggested by the server or based on the URL
          suggested_filename=”${1:-$safe_uri}”
          shift

          # the mimetype of the file being downloaded
          content_type=”$1″
          shift

          # the size of the downloaded file in bytes. this is not always accurate, since
          # the server might not have sent a size with its response headers.
          total_size=”$1″
          shift

          case “$suggested_filename” in
          # example: save torrents to a separate directory
          #*.torrent)
          # path=”$UZBL_DOWNLOAD_DIR/torrents/$suggested_filename”
          # ;;
          # Default case
          *)
          path=”$UZBL_DOWNLOAD_DIR/$suggested_filename”
          ;;
          esac

          # Do nothing if we don’t want to save the file
          [ -z “$path” ] && exit 0

          # Check if the file exists
          if [ ! -e “$path” ]; then
          echo “$path”
          exit 0
          fi

          # Try to make a unique filename
          count=1
          while [ -e “$path.$count” ]; do
          count=$(( $count + 1 ))
          done

          echo “$path.$count”

          • This reply was modified 5 years, 3 months ago by koolstofje.
          • This reply was modified 5 years, 3 months ago by koolstofje.
          #5581
          Member
          koolstofje
            Helpful
            Up
            0
            ::

            Script 4
            Go next page =]]

            Give it the name, go_nex_page.js
            Put it in, /usr/share/uzbl/examples/data/scripts

            ☟

            (function() {
            var el = document.querySelector(“[rel=’next’]”);
            if (el) { // Wow a developer that knows what he’s doing!
            location = el.href;
            }
            else { // Search from the bottom of the page up for a next link.
            var els = document.getElementsByTagName(“a”);
            var i = els.length;
            while ((el = els[–i])) {
            if (el.text.search(/\bnext\b|\bmore[\.…]*$|[>Β»]$/i) > -1) {
            location = el.href;
            break;
            }
            }
            }
            })();

            • This reply was modified 5 years, 3 months ago by koolstofje.
            #5582
            Member
            koolstofje
              Helpful
              Up
              0
              ::

              Script 5
              Go prev page =[[

              Give it the name, go_prev_page.js
              Put it in, /usr/share/uzbl/examples/data/scripts

              ☟

              (function() {
              var el = document.querySelector(“[rel=’prev’]”);
              if (el) {
              location = el.href;
              }
              else {
              var els = document.getElementsByTagName(“a”);
              var i = els.length;
              while ((el = els[–i])) {
              if (el.text.search(/\bprev|^[<Β«]/i) > -1) {
              location = el.href;
              break;
              }
              }
              }
              })();

              • This reply was modified 5 years, 3 months ago by koolstofje.
              • This reply was modified 5 years, 3 months ago by koolstofje.
              • This reply was modified 5 years, 3 months ago by koolstofje.
              #5583
              Member
              koolstofje
                Helpful
                Up
                0
                ::

                Script 6

                Insert bookmarks

                Give it the name, bookmarks
                Put it in, /home/demo/.local/share/uzbl

                To load url from bookmarks, put the url by hand in this script.
                Insert bookmarks wil not work in uzbl!!

                ☟

                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….
                http://www ….

                • This reply was modified 5 years, 3 months ago by koolstofje.
                #5584
                Member
                koolstofje
                  Helpful
                  Up
                  0
                  ::

                  Script 7

                  Firejail script,

                  Give it the name, uzbl-browser.profile
                  Put it in, /etc/firejail

                  ☟

                  # Firejail profile for uzbl-browser
                  # This file is overwritten after every install/update
                  # Persistent local customizations
                  include /etc/firejail/uzbl-browser.local
                  # Persistent global definitions
                  include /etc/firejail/globals.local

                  noblacklist ${HOME}/.config/uzbl
                  noblacklist ${HOME}/.gnupg

                  include /etc/firejail/disable-common.inc
                  include /etc/firejail/disable-devel.inc
                  include /etc/firejail/disable-programs.inc

                  mkdir ${HOME}/.config/uzbl
                  mkdir ${HOME}/.gnupg
                  mkdir ${HOME}/.local/share/uzbl
                  mkdir ${HOME}/.password-store
                  whitelist ${DOWNLOADS}
                  whitelist ${HOME}/.config/uzbl
                  whitelist ${HOME}/.gnupg
                  whitelist ${HOME}/.local/share/uzbl
                  whitelist ${HOME}/.password-store
                  include /etc/firejail/whitelist-common.inc

                  caps.drop all
                  netfilter
                  nodvd
                  nonewprivs
                  noroot
                  notv
                  protocol unix,inet,inet6
                  seccomp
                  tracelog

                  • This reply was modified 5 years, 3 months ago by koolstofje.
                  #5585
                  Member
                  koolstofje
                    Helpful
                    Up
                    0
                    ::

                    Script 8

                    scrollbar,

                    Remove scrollbar if you want…
                    Put this script ad the bottum of script, /home/demo/gtkrc2-0

                    ☟

                    tyle “uzbl” {
                    GtkRange::slider-width = 0
                    }
                    widget “Uzbl*” style “uzbl”

                    • This reply was modified 5 years, 3 months ago by koolstofje.
                    • This reply was modified 5 years, 3 months ago by koolstofje.
                    #5610
                    Moderator
                    BobC
                      Helpful
                      Up
                      0
                      ::

                      Thanks for going to the effort of posting. I don’t know if it might be too much for me. I did install it and get it to open a browser window, but I will try to find a tutorial to help me understand more how it should work. I’m sure its more than just me interested in this.

                      #5620
                      Forum Admin
                      SamK
                        Helpful
                        Up
                        0
                        ::

                        @ koolstofje
                        I also want to add thanks for the work you put into this.

                        I don’t know if it might be too much for me. I did install it and get it to open a browser window, but I will try to find a tutorial to help me understand more how it should work. I’m sure its more than just me interested in this.

                        I agree there will be others who can benefit. Perhaps you might consider documenting your experiences as you explore the browser with new eyes. Once one becomes accustomed to something it is often difficult to recall what it was like seeing it for the first time, and what obstacles were overcome to get it working as you wanted.

                        It is most likely the majority of users will only have used the monolithic, fully or over featured, heavyweight web browsers. To them the concept of a build-your-own-browser is going to appear extraordinary and potentially daunting. It might be possible to amalgamate all the emerging usage and learning into something that will assist a user move from position zero to a working outcome.

                        #5621
                        Member
                        koolstofje
                          Helpful
                          Up
                          0
                          ::

                          The original, you find it here https://wiki.archlinux.org/index.php/Uzbl

                          https://www.uzbl.org/wiki/doku.php
                          https://www.uzbl.org/wiki/scripts

                          • This reply was modified 5 years, 3 months ago by koolstofje.
                          #5676
                          Moderator
                          BobC
                            Helpful
                            Up
                            0
                            ::

                            I installed the version from the repos, which looks to be what you said to install here, but I noticed in the web browsers thread you were running a version from github.

                            Are you able to play youtube videos? They get a fuzzy screen error and the troubleshooting thing says install chrome, LOL.

                            Normal web pages seem to do fine, but I do miss the “back button”. I’ll look more to see if its on the keyboard someplace. I see it does have a download function that works as well as the ability to open a link in this window or a new one.

                            I am thinking that to run uzbl as my daily driver that I would need to have a Home web page that I would start from when I wasn’t going into a specific site from a menu or other link, and that Home webpage would include a link to a history page and a bookmarks page and the links to my favorite sites. I could navigate from there, and have keys designated to

                            Add site to Favorites
                            Edit Favorites
                            Add site to Bookmarks
                            Edit Bookmarks
                            Go to Home page
                            Go back one page
                            Go forward one page

                            I have to think a lot more on this as to whether this is something I could cobble together or create from the code of others, or whether I should just be running code, blindly, like the other 99.7%, LOL.

                            PS: It looks like you are covering at least most of the above. I suppose it isn’t necessary to be able to edit the bookmarks and favorites from the browser, as this could be done from the system menu pretty easily in Geany bringing up all uzbl related configuration files at once.

                            • This reply was modified 5 years, 3 months ago by BobC.
                            #5680
                            Member
                            koolstofje
                              Helpful
                              Up
                              0
                              ::

                              Everything works with ‘my custom’ script_config
                              Uzbl original script has not everyting bult in!

                              Install MY script config (attatsment 1)
                              Install gstreamer to watch youtube movies. Or youtube-dl script
                              Install script download.sh.

                              #5684
                              Moderator
                              BobC
                                Helpful
                                Up
                                0
                                ::

                                I have gstreamer and youtube-dl, as they are installed by default with AntiX-Full. I need to be able to play videos easily. A keystroke pair to stream/download would be fine, especially if it streamed/played the video as it downloaded and allowed me to save the download optionally or by default.

                                I was able to navigate better once I found the keyboard mapping. I have laptops, so the keys that are convenient are many times different, and the default keymap that came in the repos is very unusual for me. I would prefer the keymaps to be similar to the browsers I am required to use at work to make it easy to adapt, and am able to figure out how to do those kinds of things, usually.

                                I will try your method in the next few days.

                                #5685
                                Forum Admin
                                SamK
                                  Helpful
                                  Up
                                  0
                                  ::

                                  …especially if it streamed/played the video as it downloaded and allowed me to save the download optionally or by default.

                                  It might be worth looking at Streamlight. It works with any app including any browser, even if they do not natively support video. It also works well with ancient, resource limited kit, because of the very low demands it places on the system.

                                  The written user guide is available in the antiX FAQ:
                                  Online
                                  http://download.tuxfamily.org/antix/docs-antiX-17/FAQ/streamlight.html
                                  Locally installed
                                  See the Help section of the antiX main menu

                                  The video is available on Youtube
                                  https://www.youtube.com/watch?v=2M5B5aXBDwk

                                Viewing 15 posts - 1 through 15 (of 21 total)
                                • You must be logged in to reply to this topic.