GithubHelp home page GithubHelp logo

alandmoore / admbrowser Goto Github PK

View Code? Open in Web Editor NEW
35.0 35.0 22.0 276 KB

A Web browser for kiosks and digital signage, based on Python, PyQt, and Blink

Shell 0.13% Python 99.87%
help-wanted pyqt5 python webengine

admbrowser's People

Contributors

alandmoore avatar hunternet93 avatar stroobandt 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

Watchers

 avatar  avatar

admbrowser's Issues

setup.py install is deprecated

On Xubuntu 22.04 LTS:

~/admbrowser$ python setup.py install
running install
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: 
setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: 
easy_install command is deprecated. Use build and pip and other standards-based tools.

Geolocation & Notifications

This is to announce that I have been dabbling a bit with Qt Geolocation & Notifications in the following branch of my fork: https://github.com/stroobandt/admbrowser/tree/geolocation

Beware, this has not been properly tested yet.
Nonetheless, most if not all of the Qt infrastructure required for this has been added to this branch of ADMbrowser.

However, I am still struggling quite a bit with the Linux geoclue service and permissions. That project happens to be a complete mess and poorly documented. Is seems to be hastily pulled together to exclusively serve the need of Android smartphones. Help & testers (also on Windows/Mac) are more than welcome.

Neither have I tested notifications yet. It came as a low hanging fruit when writing the code for geolocation.

My intention for ADMbrowser geolocation is to run it on a cyberdeck as a smartphone replacer. (I hate smartphones for a slew of reasons.) Here are some examples of cyberdecks:

Custom 404 and Network error don't work

Currently no way to make the custom 404 and network error pages display, because the value passed into QtWebEngineView.loadFinished is unreliable and has many false negatives. There is also no way to inspect the reasons why loading apparently failed, or to hook into the HTTP process to view response codes, etc.

Looking for a reasonable workaround

ImportError: cannot import name 'QtWebEngineWidgets' from 'PyQt5'

2019-11-05 15_14_21-sirlattwich@sirlattwich-ntp_~_Downloads_admbrowser

[sirlattwich@sirlattwich-ntp admbrowser]$ python admbrowser.py Traceback (most recent call last): File "admbrowser.py", line 1, in <module> from admbrowser import main File "/home/sirlattwich/Downloads/admbrowser/admbrowser/__init__.py", line 1, in <module> from .browser import * File "/home/sirlattwich/Downloads/admbrowser/admbrowser/browser.py", line 21, in <module> from PyQt5 import QtWebEngineWidgets as qtwe ImportError: cannot import name 'QtWebEngineWidgets' from 'PyQt5' (/usr/lib/python3.7/site-packages/PyQt5/__init__.py)

Root cause: https://stackoverflow.com/questions/37876987/cannot-import-qtwebkitwidgets-in-pyqt5

Solution: Add "python-pyqtwebengine" to requirements
https://www.archlinux.org/packages/extra/x86_64/python-pyqtwebengine/

Download file

Hello, congratulations for the well structured and ordered code.
I ask, how can I download a file?
my call is:
<a href='Controller/name_file/date' targhet='_blank' /a>
the called controller processes the data and responds with a octed-stram header.
in my case I use codeigniter 4

return $ this-> response-> download ($ file, null) -> setFileName ($ fileName);

the browser sees the request twice.

header octed-stream
i set admbrowser.yaml

content_handlers:
  'application / octed-stram': 'file'

and the file is downloaded.
But the window new tab stays open in 'abaut: blank'.
How should I set the download header?
Or
How can I close the window new tab when the download is finished?
Thank you

just for information python-yaml is no longer maintained you have to use pyYAML.
To change in requirements.

admbrowser.py needs a "crunch bang" statement

admbrowser.py needs the "crunch bang" statement #!/usr/bin/env python to render it executable on *nix systems as per documentation.

The documentation also needs editing as it mentions browser.py, whereas it should read admbrowser.py.

#!/usr/bin/env python is preferred over #!/usr/bin/python as this is less dogmatic about the organisation of the file system. For example, the first statement will work on BSD systems, whereas the second will not.

I have prepared two pull requests that resolve these issues:

Develop error-message display system

Use QMessageBox to display some errors rather than overwriting the contents of the browser window and leaving a user stranded on a nonexistent page.

Possible errors to display:

  • disallowed actions
  • problems with download display
  • SSL errors?

quit shortcut

if not hasattr(self, 'really_quit'): 
    # set hidden quit action
    self.really_quit = self.createAction(
        "",
        self.close,
        qtg.QKeySequence("Ctrl+Alt+Q"),
        None,
        ""
    )

Should solve your Ambiguos shortcut issue..

Popup windows do not inherit a number of essential properties

Popup windows, when allowed by allow_popups, do not inherit some essential properties, such as:
navigation, window_icon, window_size and window_title.

By consequence, popup windows open with the smallest possible dimensions on the desktop, after which one needs to maximise these to even see these.

The zoom_factor is correctly inherited, though.

User and password are not filled in on Jellyfin

The user and password are not automatically filled in —like other browsers with password management do— on the Jellyfin media system.

This can be tested with the following demo YAML file:

default_password: ''
default_user: demo
navigation: False
start_url: https://demo.jellyfin.org/stable/web/index.html
window_size: max

This would be nice to have for a kiosk browser without keyboard.

Can't run on Raspberry Pi

ADMBrowser can't run on latest version of Raspbian (Buster).

After I have installed PyQt5 with sudo apt-get install python3-pyqt5 when I try to run python3 admbrowser.py I get the following error:

Traceback (most recent call last):
  File "admbrowser.py", line 1, in <module>
    from admbrowser import main
  File "/home/pi/admbrowser/admbrowser/__init__.py", line 1, in <module>
    from .browser import *
  File "/home/pi/admbrowser/admbrowser/browser.py", line 21, in <module>
    from PyQt5 import QtWebEngineWidgets as qtwe
ImportError: cannot import name 'QtWebEngineWidgets' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/__init__.py)

Do you know a workaround to make it working on Raspberry Pi?

CSS overwrite statements in .yaml file

This is an idea that originates from the surf browser. Suckless.org's surf is a small WebKit2/GTK+ based browser that I used to use quite often before encountering this great WebEngine/PyQt5 ADMBrowser.

surf allows to write a couple of CSS statements that will overwrite some of the CSS of a known web site. This results to be a handy way to eleminate ads and other annoyances or rather to emphasise parts of a web page one is interested in.

Here is an actual example for some of the named CSS classes of the domain rtl.fr:

.ads, .legal-notice, .newsletter, .produit {display: none !important;}
.hResultPrincipal {font-size: 175% !important;}

CSS overwrite statements would be a great and natural addition to ADMBrowser's .yaml site-dependent configuration files. It would also solve the issue of ADMBrowser users currently being exposed to ads that could be perceived as offensive in an educational or public library setting.

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.