Last active
May 3, 2016 22:14
-
-
Save iamutkarshtiwari/78c9a3123dcb3201db329a2e343fcb66 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.load_uri('about:blank') | |
text_script = "document.write('" + text.str + "');" | |
browser.execute_script(text_script) | |
browser.grab_focus() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment