sugar-toolkit-gtk3/sugar/browser/__init__.py

31 lines
973 B
Python
Raw Normal View History

"""Sugar's web-browser activity
XUL Runner and gtkmozembed and is produced by the PyGTK
.defs system.
"""
2007-04-15 15:41:47 +02:00
try:
2007-05-13 22:49:27 +02:00
from sugar.browser._sugarbrowser import startup, shutdown
from sugar.browser import _sugarbrowser
2007-04-15 15:41:47 +02:00
except ImportError:
from sugar import ltihooks
2007-05-13 22:49:27 +02:00
from sugar.browser._sugarbrowser import startup, shutdown
from sugar.browser import _sugarbrowser
class Browser(_sugarbrowser.Browser):
def __init__(self):
_sugarbrowser.Browser.__init__(self)
def get_browser(self):
from xpcom import components
cls = components.classes["@laptop.org/browser/browserhelper;1"]
browser_helper = cls.getService(components.interfaces.nsIBrowserHelper)
print self.get_instance_id()
return browser_helper.getBrowser(self.get_instance_id())
def get_document(self):
return self.browser.contentDOMWindow.document
document = property(get_document)
browser = property(get_browser)