Skip to content

Commit 7e279bc

Browse files
Steve BlockAndroid (Google) Code Review
authored andcommitted
Merge "Tweak JavaDoc for WebSettings.setAllowUniversalAccessFromFileURLs() and setAllowFileAccessFromFileURLs()" into jb-dev
2 parents c6911d4 + ef16315 commit 7e279bc

File tree

1 file changed

+34
-21
lines changed

1 file changed

+34
-21
lines changed

core/java/android/webkit/WebSettings.java

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -848,25 +848,37 @@ public synchronized void setJavaScriptEnabled(boolean flag) {
848848
}
849849

850850
/**
851-
* Configures scripting (such as XmlHttpRequest) access from file scheme URLs
852-
* to any origin. Note, calling this method with a true argument value also
853-
* implies calling setAllowFileAccessFromFileURLs with a true. The default
854-
* value is false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
855-
* and higher and true otherwise.
851+
* Sets whether JavaScript running in the context of a file scheme URL
852+
* should be allowed to access content from any origin. This includes
853+
* access to content from other file scheme URLs. See
854+
* {@link #setAllowFileAccessFromFileURLs}. To enable the most restrictive,
855+
* and therefore secure policy, this setting should be disabled.
856+
* <p>
857+
* The default value is true for API level
858+
* {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1} and below,
859+
* and false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
860+
* and above.
856861
*
857-
* @param flag true if the WebView should allow scripting access from file
858-
* scheme URLs to any origin
862+
* @param flag whether JavaScript running in the context of a file scheme
863+
* URL should be allowed to access content from any origin
859864
*/
860865
public abstract void setAllowUniversalAccessFromFileURLs(boolean flag);
861866

862867
/**
863-
* Configures scripting (such as XmlHttpRequest) access from file scheme URLs
864-
* to file origin. The default value is false for API level
865-
* {@link android.os.Build.VERSION_CODES#JELLY_BEAN} and higher and true
866-
* otherwise.
868+
* Sets whether JavaScript running in the context of a file scheme URL
869+
* should be allowed to access content from other file scheme URLs. To
870+
* enable the most restrictive, and therefore secure policy, this setting
871+
* should be disabled. Note that the value of this setting is ignored if
872+
* the value of {@link #getAllowUniversalAccessFromFileURLs} is true.
873+
* <p>
874+
* The default value is true for API level
875+
* {@link android.os.Build.VERSION_CODES#ICE_CREAM_SANDWICH_MR1} and below,
876+
* and false for API level {@link android.os.Build.VERSION_CODES#JELLY_BEAN}
877+
* and above.
867878
*
868-
* @param flag true if the WebView should allow scripting access from file
869-
* scheme URLs to file origin
879+
* @param flag whether JavaScript running in the context of a file scheme
880+
* URL should be allowed to access content from other file
881+
* scheme URLs
870882
*/
871883
public abstract void setAllowFileAccessFromFileURLs(boolean flag);
872884

@@ -1028,21 +1040,22 @@ public synchronized boolean getJavaScriptEnabled() {
10281040
}
10291041

10301042
/**
1031-
* Gets whether scripting access {see @setAllowUniversalAccessFromFileURLs} from
1032-
* file URLs to any origin is enabled.
1043+
* Gets whether JavaScript running in the context of a file scheme URL can
1044+
* access content from any origin. This includes access to content from
1045+
* other file scheme URLs.
10331046
*
1034-
* @return true if the WebView allows scripting access from file scheme requests
1035-
* to any origin
1047+
* @return whether JavaScript running in the context of a file scheme URL
1048+
* can access content from any origin
10361049
* @see #setAllowUniversalAccessFromFileURLs
10371050
*/
10381051
public abstract boolean getAllowUniversalAccessFromFileURLs();
10391052

10401053
/**
1041-
* Gets whether scripting access {see @setAllowFileAccessFromFileURLs} from file
1042-
* URLs to file origin is enabled.
1054+
* Gets whether JavaScript running in the context of a file scheme URL can
1055+
* access content from other file scheme URLs.
10431056
*
1044-
* @return true if the WebView allows scripting access from file scheme requests
1045-
* to file origin
1057+
* @return whether JavaScript running in the context of a file scheme URL
1058+
* can access content from other file scheme URLs
10461059
* @see #setAllowFileAccessFromFileURLs
10471060
*/
10481061
public abstract boolean getAllowFileAccessFromFileURLs();

0 commit comments

Comments
 (0)