2011-01-09, 02:29
Web Viewer is a linear text web browser. It is linear because it doesn't render pages, it filters them and displays text in the order it is found in the original HTML.
Get the latest version on my REPO.
If you need help, ask a question in this thread or join #ruuk on freenode.
What it does:
* You can follow links, fill out forms, view images
* Stream video/audio links
* It has back/forward history
* Bookmarks
What it doesn't do:
* Handle style sheets, javascript, flash, etc.
* Make web pages look good
* Lots of other stuff
Web viewer also allows addon developers to process application authorization (ie. facebook,flickr etc.) with little programming and without violating terms of use and also provides the ability to show web pages directly from an addon.
The basic usage as of v0.7.4 is:
from webviewer import webviewer
url, html = webviewer.getWebResult(url,autoForms=[],autoClose=None,dialog=False)
This returns the url and html of the page when the browser was closed.
The autoforms parameter is for auto selecting forms and is a list of dicts as follows:
{ 'name': 'exact name of form',
'action': 'a substring of the form action',
'index': 'index of the form in the html' }
A match will occur if any of the items in the dict matches,
except if name or action matches and index is defined, the index must also match.
The autoClose parameter is for matching a page where the window should close.
If matched it will present a dialog asking to close with the provided heading and message.
It is a dict as follows:
{ 'url': 'regex to match against page url',
'html': 'regex to match against page html',
'heading': 'heading for dialog',
'message': 'message for dialog' }
You can specify url, html, or both. A match will only occur if all provided regular expressions match.
Setting the dialog parameter to true will cause the browser to open as a dialog instead as a normal window.