Skip to content

Commit f0a694a

Browse files
authored
Merge pull request #408 from Iterable/jay/MOB-3767-js
[MOB-3767] set in-app javascript execution to false
2 parents 5f38aad + d3d7966 commit f0a694a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/src/androidTest/java/com/iterable/iterableapi/MainActivityTest.java

+4
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public void checkIfMessageShownAsPopUpForImproperIntent() throws Exception {
145145
onView(withText("Tips and tricks 2")).perform(click());
146146
intended(allOf(hasComponent(IterableInboxMessageActivity.class.getName())), times(0));
147147
onView(withId(R.id.webView)).inRoot(isDialog()).check(matches(isDisplayed()));
148+
onWebView(withId(R.id.webView)).forceJavascriptEnabled();
148149
onWebView().withElement(findElement(Locator.XPATH, "//*[contains(text(),'Ok, got it')]"));
149150
}
150151

@@ -165,6 +166,7 @@ public void checkIfMessageShownAsPopUpForUnexpectedIntent() throws Exception {
165166
onView(withText("Tips and tricks 2")).perform(click());
166167
intended(allOf(hasComponent(IterableInboxMessageActivity.class.getName())), times(0));
167168
onView(withId(R.id.webView)).inRoot(isDialog()).check(matches(isDisplayed()));
169+
onWebView(withId(R.id.webView)).forceJavascriptEnabled();
168170
onWebView().withElement(findElement(Locator.XPATH, "//*[contains(text(),'Ok, got it')]"));
169171
}
170172

@@ -182,6 +184,7 @@ public void checkIfMessageShownAsPopUpForNoIntent() throws Exception {
182184
onView(withText("Tips and tricks 2")).perform(click());
183185
intended(allOf(hasComponent(IterableInboxMessageActivity.class.getName())), times(0));
184186
onView(withId(R.id.webView)).inRoot(isDialog()).check(matches(isDisplayed()));
187+
onWebView(withId(R.id.webView)).forceJavascriptEnabled();
185188
onWebView().withElement(findElement(Locator.XPATH, "//*[contains(text(),'Ok, got it')]"));
186189
}
187190

@@ -203,6 +206,7 @@ public void checkIfMessageShownAsPopUp() throws Exception {
203206
onView(withText("Tips and tricks 2")).perform(click());
204207
intended(allOf(hasComponent(IterableInboxMessageActivity.class.getName())), times(0));
205208
onView(withId(R.id.webView)).inRoot(isDialog()).check(matches(isDisplayed()));
209+
onWebView(withId(R.id.webView)).forceJavascriptEnabled();
206210
onWebView().withElement(findElement(Locator.XPATH, "//*[contains(text(),'Ok, got it')]"));
207211
}
208212

iterableapi/src/main/java/com/iterable/iterableapi/IterableWebView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ public void onProgressChanged(WebView view, int newProgress) {
5151
getSettings().setAllowContentAccess(false);
5252

5353
//resize:
54-
getSettings().setJavaScriptEnabled(true);
54+
getSettings().setJavaScriptEnabled(false);
5555
}
5656
}

0 commit comments

Comments
 (0)