openLocationLastURL.jsm 编辑
This component has been removed from the platform in Firefox 29. (bug 953124)
The openLocationLastURL.jsm
JavaScript code module lets you set and retrieve the URL most recently opened using the "Open Location" option in the File menu.
To use this, you first need to import the code module into your JavaScript scope:
Components.utils.import("resource:///modules/openLocationLastURL.jsm");
Once you've imported the module, you can then use the OpenLocationLastURL
object it exports. This object lets you fetch and change the URL that is placed in the "Open Location" dialog box when it opens.
If the user is not in private browsing mode, this automatically updates the value of the general.open_location.last_url
preference.
Using the OpenLocationLastURL object
To get or set the value of the Open Location edit box, simply read the value of, or set the value of, the OpenLocationLastURL.value
field:
var url = OpenLocationLastURL.value;
OpenLocationLastURL.value = "http://www.mozilla.org/";
To reset the value of the edit box to the default (which is an empty string), you can call the reset()
method:
Method overview
reset() |
Methods
reset
The reset()
method resets the saved URL to the default, which is an empty string.
reset();
Parameters
None.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论