Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save iamutkarshtiwari/bc23eb594e5d11d9a76de869c2804626 to your computer and use it in GitHub Desktop.

Select an option

Save iamutkarshtiwari/bc23eb594e5d11d9a76de869c2804626 to your computer and use it in GitHub Desktop.
def _view_page_source_cb(self, button):
browser = self._activity._tabbed_view.props.current_browser
text = browser.get_main_frame().get_data_source().get_data()
print type(text.str)
browser = self._activity._tabbed_view.add_tab(next_to_current=True)
#browser.get_source(self._open_with_source, self._open_empty)
#browser = self._activity._tabbed_view.props.current_browser
browser.load_uri('about:blank')
#browser.execute_script("hey ha")
text_script = "document.write(" + text.str + ");"
#"var iframe = document.getElementById('iframe');" \
# "iframe.src = '" + self._index_html_path + "';"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment