Opens a local html file into the browser from a relative file path. The URL displayed in the web browser will start with "file://".
(self, html_file)
| 3445 | self.load_html_string(html_string, new_page) |
| 3446 | |
| 3447 | def open_html_file(self, html_file): |
| 3448 | """Opens a local html file into the browser from a relative file path. |
| 3449 | The URL displayed in the web browser will start with "file://".""" |
| 3450 | self.__check_scope() |
| 3451 | if self.__looks_like_a_page_url(html_file): |
| 3452 | self.open(html_file) |
| 3453 | return |
| 3454 | if len(html_file) < 6 or not html_file.endswith(".html"): |
| 3455 | raise Exception('Expecting a ".html" file!') |
| 3456 | abs_path = os.path.abspath(".") |
| 3457 | file_path = None |
| 3458 | if abs_path in html_file: |
| 3459 | file_path = html_file |
| 3460 | else: |
| 3461 | file_path = os.path.join(abs_path, html_file) |
| 3462 | self.open("file://" + file_path) |
| 3463 | |
| 3464 | def evaluate(self, expression): |
| 3465 | """Run a JavaScript expression and return the result.""" |
no test coverage detected