A Tizen Web application includes a web view and the properties below of the web view can be managed via the Web setting API:
Note that all the settings using the Web setting API is bound to your application; thus, no other applications are affected via the Web setting API calls within your application.
For more information on the Web setting features, see Web View Settings Guide.
Since: 2.4
Interface | Method |
---|---|
WebSettingObject | |
WebSettingManager |
void setUserAgentString (DOMString userAgent, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
void removeAllCookies (optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) |
[NoInterfaceObject] interface WebSettingObject {
readonly attribute WebSettingManager websetting;
};
Tizen implements WebSettingObject;
Since: 2.4
tizen.websetting object is available to manage the settings of the Web view in your Web application.
[NoInterfaceObject] interface WebSettingManager {
void setUserAgentString(DOMString userAgent,
optional SuccessCallback? successCallback,
optional ErrorCallback? errorCallback) raises (WebAPIException);
void removeAllCookies(optional SuccessCallback? successCallback,
optional ErrorCallback? errorCallback) raises (WebAPIException);
};
setUserAgentString
void setUserAgentString(DOMString userAgent, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
Since: 2.4
This method allows the user to set the user agent string of the Web view in the Web application. By default, the Web view in your application has the same user agent string as the Tizen browser on the device.
The ErrorCallback is launched with these error types:
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
Code example:
function successCallback() {
console.log("The requested user agent string has just been set successfully.");
}
tizen.websetting.setUserAgentString("the new user agent string to set", successCallback);
removeAllCookies
void removeAllCookies(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
Since: 2.4
The Web view in your Web application can store cookies like a browser. This method allows the user to remove all the cookies saved for the Web application.
The ErrorCallback is launched with these error types:
Warning: http://tizen.org/privilege/websetting(public level privilege) MUST NOT be declared to use this API since 2.4.
Parameters:
Exceptions:
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
Code example:
function successCallback() {
console.log("The cookies saved for your application have just been removed.");
}
tizen.websetting.removeAllCookies(successCallback);
module WebSetting {
[NoInterfaceObject] interface WebSettingObject {
readonly attribute WebSettingManager websetting;
};
Tizen implements WebSettingObject;
[NoInterfaceObject] interface WebSettingManager {
void setUserAgentString(DOMString userAgent,
optional SuccessCallback? successCallback,
optional ErrorCallback? errorCallback) raises (WebAPIException);
void removeAllCookies(optional SuccessCallback? successCallback,
optional ErrorCallback? errorCallback) raises (WebAPIException);
};
};