Last active
August 29, 2015 14:05
-
-
Save jehoshua02/d89cf5c8aa81337eb1eb to your computer and use it in GitHub Desktop.
Check a url in all browsers!
This file contains 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
#!/bin/bash | |
URL= | |
FIREFOX=false | |
CHROME=false | |
SAFARI=false | |
IE10=false | |
IE11=false | |
IE8=false | |
SAFARI_MOBILE=false | |
while getopts "u:acfsSeEi" opt; do | |
case $opt in | |
a) | |
FIREFOX=true | |
CHROME=true | |
SAFARI=true | |
IE10=true | |
IE11=true | |
IE8=true | |
SAFARI_MOBILE=true | |
;; | |
c) | |
CHROME=true | |
;; | |
f) | |
FIREFOX=true | |
;; | |
s) | |
SAFARI=true | |
;; | |
S) | |
SAFARI_MOBILE=true | |
;; | |
e) | |
IE10=true | |
;; | |
E) | |
IE11=true | |
;; | |
i) | |
IE8=true | |
;; | |
u) | |
URL=$OPTARG | |
;; | |
\?) | |
echo "Invalid option: -$OPTARG" >&2 | |
;; | |
:) | |
echo "Option -$OPTARG requires an argument." >&2 | |
esac | |
done | |
echo "URL: $URL" | |
if [ "$FIREFOX" = true ] ; then | |
echo "open in firefox" | |
open -a firefox $URL | |
fi | |
if [ "$CHROME" = true ] ; then | |
echo "open in chrome" | |
open -a 'Google Chrome' $URL | |
fi | |
if [ "$SAFARI" = true ] ; then | |
echo "open in safari" | |
open -a safari $URL | |
fi | |
if [ "$SAFARI_MOBILE" = true ] ; then | |
echo "open in safari mobile" | |
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.*.sdk/Applications/MobileSafari.app/MobileSafari -u $URL & | |
fi | |
if [ "$IE11" = true ] ; then | |
echo "open in IE10" | |
vboxmanage startvm 'IE11 - Win8.1' | |
sleep 20 | |
vboxmanage guestcontrol 'IE11 - Win8.1' exec --image 'C:\Program Files\Internet Explorer\iexplore.exe' --username IEUser --password 'Passw0rd!' --verbose -- $URL | |
fi | |
if [ "$IE10" = true ] ; then | |
echo "open in IE11" | |
vboxmanage startvm 'IE10 - Win8' | |
sleep 20 | |
vboxmanage guestcontrol 'IE10 - Win8' exec --image 'C:\Program Files\Internet Explorer\iexplore.exe' --username IEUser --password 'Passw0rd!' --verbose -- $URL | |
fi | |
if [ "$IE8" = true ] ; then | |
echo "open in IE8" | |
vboxmanage startvm 'IE8 - WinXP' | |
sleep 20 | |
vboxmanage guestcontrol 'IE8 - WinXP' exec --image 'C:\Program Files\Internet Explorer\iexplore.exe' --username IEUser --password 'Passw0rd!' --verbose -- $URL | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment