Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(157161)

Side by Side Diff: Lib/webbrowser.py

Issue 24452: Make webbrowser support Chrome on Mac OS X
Patch Set: Created 3 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #! /usr/bin/env python3 1 #! /usr/bin/env python3
2 """Interfaces for launching and remotely controlling Web browsers.""" 2 """Interfaces for launching and remotely controlling Web browsers."""
3 # Maintained by Georg Brandl. 3 # Maintained by Georg Brandl.
4 4
5 import os 5 import os
6 import shlex 6 import shlex
7 import shutil 7 import shutil
8 import sys 8 import sys
9 import subprocess 9 import subprocess
10 10
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 593
594 osapipe.write(script) 594 osapipe.write(script)
595 rc = osapipe.close() 595 rc = osapipe.close()
596 return not rc 596 return not rc
597 597
598 598
599 # Don't clear _tryorder or _browsers since OS X can use above Unix support 599 # Don't clear _tryorder or _browsers since OS X can use above Unix support
600 # (but we prefer using the OS X specific stuff) 600 # (but we prefer using the OS X specific stuff)
601 register("safari", None, MacOSXOSAScript('safari'), -1) 601 register("safari", None, MacOSXOSAScript('safari'), -1)
602 register("firefox", None, MacOSXOSAScript('firefox'), -1) 602 register("firefox", None, MacOSXOSAScript('firefox'), -1)
603 register("chrome", None, MacOSXOSAScript('chrome'), -1)
603 register("MacOSX", None, MacOSXOSAScript('default'), -1) 604 register("MacOSX", None, MacOSXOSAScript('default'), -1)
604 605
605 606
606 # OK, now that we know what the default preference orders for each 607 # OK, now that we know what the default preference orders for each
607 # platform are, allow user to override them with the BROWSER variable. 608 # platform are, allow user to override them with the BROWSER variable.
608 if "BROWSER" in os.environ: 609 if "BROWSER" in os.environ:
609 _userchoices = os.environ["BROWSER"].split(os.pathsep) 610 _userchoices = os.environ["BROWSER"].split(os.pathsep)
610 _userchoices.reverse() 611 _userchoices.reverse()
611 612
612 # Treat choices in same way as if passed into get() but do register 613 # Treat choices in same way as if passed into get() but do register
(...skipping 29 matching lines...) Expand all
642 print(usage, file=sys.stderr) 643 print(usage, file=sys.stderr)
643 sys.exit(1) 644 sys.exit(1)
644 645
645 url = args[0] 646 url = args[0]
646 open(url, new_win) 647 open(url, new_win)
647 648
648 print("\a") 649 print("\a")
649 650
650 if __name__ == "__main__": 651 if __name__ == "__main__":
651 main() 652 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+