39
39
40
40
import com .google .gson .JsonObject ;
41
41
42
- import com .groupon .seleniumgridextras .ExecuteCommand ;
43
-
42
+ import com .groupon .seleniumgridextras .config .RuntimeConfig ;
44
43
import java .util .HashMap ;
45
44
import java .util .Map ;
46
45
@@ -106,8 +105,6 @@ public String getCurrentSettingForZone(String zoneId) {
106
105
return String .format (regLocation , zoneId );
107
106
}
108
107
109
- ;
110
-
111
108
112
109
@ Override
113
110
public JsonObject execute (Map <String , String > parameter ) {
@@ -119,14 +116,24 @@ public JsonObject execute(Map<String, String> parameter) {
119
116
120
117
@ Override
121
118
public JsonObject execute () {
122
- return getAllProtectedStatus ();
119
+ if (RuntimeConfig .getOS ().isWindows ()) {
120
+ return getAllProtectedStatus ();
121
+ } else {
122
+ getJsonResponse ().addKeyValues ("error" , "IE Protected Mode command is only implemented in Windows" );
123
+ return getJsonResponse ().getJson ();
124
+ }
123
125
}
124
126
125
127
@ Override
126
128
public JsonObject execute (String status ) {
127
- setAllProtectedStatuses (status .equals ("1" ) ? true : false );
128
- getJsonResponse ().addKeyValues ("out" , "IE needs to restart before you see the changes" );
129
- return getAllProtectedStatus ();
129
+ if (RuntimeConfig .getOS ().isWindows ()) {
130
+ setAllProtectedStatuses (status .equals ("1" ) ? true : false );
131
+ getJsonResponse ().addKeyValues ("out" , "IE needs to restart before you see the changes" );
132
+ return getAllProtectedStatus ();
133
+ } else {
134
+ getJsonResponse ().addKeyValues ("error" , "IE Protected Mode command is only implemented in Windows" );
135
+ return getJsonResponse ().getJson ();
136
+ }
130
137
}
131
138
132
139
private void setAllProtectedStatuses (boolean value ) {
@@ -142,8 +149,6 @@ private void setAllProtectedStatuses(boolean value) {
142
149
}
143
150
}
144
151
145
- ;
146
-
147
152
148
153
private Boolean getProtectedEnabledForZone (String zone ) {
149
154
int enabled =
0 commit comments