Skip to content

Commit

Permalink
Introduce configuration options
Browse files Browse the repository at this point in the history
Add more configuration. At the moment there are following two settings:
 * set an own user-agent
 * enable developer extras (aka Firebug)
  • Loading branch information
KaiserBarbarossa committed Feb 10, 2021
1 parent 68fcf25 commit cef2ec5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mybrowse.py
Expand Up @@ -85,6 +85,10 @@ def __init__(self):
self.view.connect("notify::uri", self.change_uri)
self.view.connect("notify::title", self.change_title)

settings = self.view.get_settings()
settings.set_property('user-agent', config['Browser']['user-agent'])
settings.set_property('enable-developer-extras', config['Browser']['firebug'])

def change_url(self, widget):
url = self.addressbar.get_text()
if not ":" in url:
Expand Down Expand Up @@ -120,7 +124,6 @@ def search(self, searchbar):

def set_bookmark(self, widget):
url = self.addressbar.get_text()
title = self.view.get_title()
bm_file = open(conf_dir + 'bookmarks.html', 'a')
bm_file.write('<a href="' + url + '">' + title + '</a><br>\r\n')
bm_file.close()
Expand Down

0 comments on commit cef2ec5

Please sign in to comment.