override default JS dialog handling (which is broken in Lollipop)

should fix #970
This commit is contained in:
fkloft
2015-04-09 23:31:37 +02:00
parent 1171651991
commit 9092a2a038
6 changed files with 252 additions and 2 deletions

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:textSize="18sp"/>
<EditText
android:id="@+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dip"
android:inputType="text"
android:scrollHorizontally="true"
android:selectAllOnFocus="true"/>
</LinearLayout>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Title for a JavaScript dialog. "The page at <url of current page> says:" -->
<string name="js_dialog_title">The page at \"%s\" says:</string>
<!-- Default title for a javascript dialog -->
<string name="js_dialog_title_default">JavaScript</string>
<!-- Title for the unload javascript dialog -->
<string name="js_dialog_before_unload_title">Confirm Navigation</string>
<!-- Text for the positive button on the unload javascript dialog -->
<string name="js_dialog_before_unload_positive_button">Leave this Page</string>
<!-- Text for the negative button on the unload javascript dialog -->
<string name="js_dialog_before_unload_negative_button">Stay on this Page</string>
<!-- Message in a javascript dialog asking if the user wishes to leave the current page -->
<string name="js_dialog_before_unload">%s\n\nAre you sure you want to navigate away from this page?</string>
</resources>