def browserQuit(self, replyto='no-one'): """Called to recover where the browser is looking currently. """ control_frame = {'command': 'exit', 'args': {}} d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) self.log.debug("browserQuit: Sending command: %s " % str(d)) rc = self.write(d) self.log.debug("browserQuit: rc %s" % str(rc)) return rc
def getBrowserUri(self, replyto='no-one'): """Called to recover where the browser is looking currently. """ control_frame = {'command': 'get_uri', 'args': {}} d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) #self.log.debug("getBrowserUri: Sending command %s" % str(d)) rc = self.write(d) #self.log.debug("getBrowserUri: rc %s" % str(rc)) return rc
def callFunction(self, args, replyto="no-one"): """Call a javascript function in the browser. """ control_frame = {"command": "call", "args": {"call": args}} d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) self.log.debug("callFunction: Sending command: %s " % str(d)) rc = self.write(d) self.log.debug("callFunction: rc %s " % str(rc)) return rc
def getBrowserUri(self, replyto="no-one"): """Called to recover where the browser is looking currently. """ control_frame = {"command": "get_uri", "args": {}} d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) # self.log.debug("getBrowserUri: Sending command %s" % str(d)) rc = self.write(d) # self.log.debug("getBrowserUri: rc %s" % str(rc)) return rc
def browserQuit(self, replyto="no-one"): """Called to recover where the browser is looking currently. """ control_frame = {"command": "exit", "args": {}} d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) self.log.debug("browserQuit: Sending command: %s " % str(d)) rc = self.write(d) self.log.debug("browserQuit: rc %s" % str(rc)) return rc
def setBrowserUri(self, args, replyto='no-one'): """Called to tell the XUL Browser where to point """ # Go to yahoo: control_frame = {'command': 'set_uri', 'args': {'uri': args}} d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) self.log.debug("setBrowserUri: Sending command: %s " % str(d)) rc = self.write(d) self.log.debug("setBrowserUri: rc %s " % str(rc)) return rc
def setBrowserUri(self, args, replyto="no-one"): """Called to tell the XUL Browser where to point """ # Go to yahoo: control_frame = {"command": "set_uri", "args": {"uri": args}} d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) self.log.debug("setBrowserUri: Sending command: %s " % str(d)) rc = self.write(d) self.log.debug("setBrowserUri: rc %s " % str(rc)) return rc
def replaceContent(self, content_id, content, replyto="no-one"): """Called to replace content inside the viewpoint browser window with the given content fragment. """ content = urllib.quote(content) control_frame = {"command": "replace", "args": {"id": content_id, "content": content}} d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) self.log.debug("replaceContent: Sending command: %s " % str(d)) rc = self.write(d) self.log.debug("replaceContent: rc %s " % str(rc)) return rc
def callFunction(self, args, replyto='no-one'): """Call a javascript function in the browser. """ control_frame = { 'command': 'call', 'args': { 'call': args, } } d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) self.log.debug("callFunction: Sending command: %s " % str(d)) rc = self.write(d) self.log.debug("callFunction: rc %s " % str(rc)) return rc
def replaceContent(self, content_id, content, replyto='no-one'): """Called to replace content inside the viewpoint browser window with the given content fragment. """ content = urllib.quote(content) control_frame = { 'command': 'replace', 'args': { 'id': content_id, 'content': content } } d = dict(replyto=replyto, data=control_frame) d = xulcontrolprotocol.dump(d) self.log.debug("replaceContent: Sending command: %s " % str(d)) rc = self.write(d) self.log.debug("replaceContent: rc %s " % str(rc)) return rc