This WebSetting API defines a set of APIs that manages the setting states of the Web view in your Web application.
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.2
This interface defines what is instantiated for the Web setting API by the Tizen object from the Tizen Platform.
[NoInterfaceObject] interface WebSettingObject { readonly attribute WebSettingManager websetting; };
Tizen implements WebSettingObject;
tizen.websetting object is available to manage the settings of the Web view in your Web application.
This is the top-level interface for the WebSetting API that managed 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
Sets the custom user agent string for your Web application.
void setUserAgentString(DOMString userAgent, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
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:
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
Removes all the cookies saved for the Web view in your Web application.
void removeAllCookies(optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback);
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.
Warning: http://tizen.org/privilege/websetting(public level privilege) MUST NOT be declared to use this API since 2.4.
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); }; };