c84e21aa9e
Fix sugar.Browser
32 lines
955 B
Python
32 lines
955 B
Python
"""Sugar's web-browser activity
|
|
|
|
XUL Runner and gtkmozembed and is produced by the PyGTK
|
|
.defs system.
|
|
"""
|
|
|
|
try:
|
|
from sugar.browser import _sugarbrowser
|
|
except ImportError:
|
|
from sugar import ltihooks
|
|
from sugar.browser import _sugarbrowser
|
|
|
|
from _sugarbrowser import AddressEntry
|
|
from _sugarbrowser import startup, shutdown, get_download_manager
|
|
|
|
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)
|