From f7ac37d849de074e0622dc1e2936e4ab005878a6 Mon Sep 17 00:00:00 2001 From: Bobby Powers Date: Wed, 04 Mar 2009 01:17:47 +0000 Subject: 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 --- 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) -- cgit v0.9.1