Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBobby Powers <bobby@laptop.org>2009-03-04 01:17:47 (GMT)
committer Bobby Powers <bobby@laptop.org>2009-03-04 01:17:47 (GMT)
commitf7ac37d849de074e0622dc1e2936e4ab005878a6 (patch)
tree222522ba62d4151def57c743715a4ad37f68aabd
parent48ac4b11719603d6dda840b7418364b9e1d6097c (diff)
apply either an agent or user stylesheet to each page
* WebKit seems to only allow you to apply one, so in this case the user stylesheet (if there, which one isn't for me) will override the agent one
-rw-r--r--browser.py34
1 files changed, 8 insertions, 26 deletions
diff --git a/browser.py b/browser.py
index d995317..0bb2346 100644
--- a/browser.py
+++ b/browser.py
@@ -101,33 +101,15 @@ class Browser(WebView):
self._jobject = None
- #io_service_class = components.classes[ \
- # "@mozilla.org/network/io-service;1"]
- #io_service = io_service_class.getService(interfaces.nsIIOService)
-
- # Use xpcom to turn off "offline mode" detection, which disables
- # access to localhost for no good reason. (Trac #6250.)
- #io_service2 = io_service_class.getService(interfaces.nsIIOService2)
- #io_service2.manageOfflineStatus = False
-
- #cls = components.classes['@mozilla.org/content/style-sheet-service;1']
- #style_sheet_service = cls.getService(interfaces.nsIStyleSheetService)
-
- #if os.path.exists(Browser.AGENT_SHEET):
- # agent_sheet_uri = io_service.newURI('file:///' +
- # Browser.AGENT_SHEET,
- # None, None)
- # style_sheet_service.loadAndRegisterSheet(agent_sheet_uri,
- # interfaces.nsIStyleSheetService.AGENT_SHEET)
-
- #if os.path.exists(Browser.USER_SHEET):
- # user_sheet_uri = io_service.newURI('file:///' + Browser.USER_SHEET,
- # None, None)
- # style_sheet_service.loadAndRegisterSheet(user_sheet_uri,
- # interfaces.nsIStyleSheetService.USER_SHEET)
-
settings = self.get_settings()
- settings.set_property("enable-developer-extras", True)
+
+ if os.path.exists(Browser.AGENT_SHEET):
+ # used to disable flash movies until you click them.
+ settings.set_property('user-stylesheet-uri', 'file:///' +
+ Browser.AGENT_SHEET)
+ if os.path.exists(Browser.USER_SHEET):
+ settings.set_property('user-stylesheet-uri', 'file:///' +
+ Browser.USER_SHEET)
# scale other content besides from text as well
self.set_full_content_zoom(True)