mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-09-09 04:54:33 +00:00
parent
9a87f47d8e
commit
438ff2c96f
@ -2913,8 +2913,6 @@ ContentPermissionPrompt.prototype = {
|
|||||||
|
|
||||||
var DefaultBrowserCheck = {
|
var DefaultBrowserCheck = {
|
||||||
get OPTIONPOPUP() { return "defaultBrowserNotificationPopup" },
|
get OPTIONPOPUP() { return "defaultBrowserNotificationPopup" },
|
||||||
_setAsDefaultTimer: null,
|
|
||||||
_setAsDefaultButtonClickStartTime: 0,
|
|
||||||
|
|
||||||
closePrompt: function(aNode) {
|
closePrompt: function(aNode) {
|
||||||
if (this._notification) {
|
if (this._notification) {
|
||||||
@ -2937,37 +2935,6 @@ var DefaultBrowserCheck = {
|
|||||||
#endif
|
#endif
|
||||||
try {
|
try {
|
||||||
ShellService.setDefaultBrowser(claimAllTypes, false);
|
ShellService.setDefaultBrowser(claimAllTypes, false);
|
||||||
|
|
||||||
if (this._setAsDefaultTimer) {
|
|
||||||
this._setAsDefaultTimer.cancel();
|
|
||||||
}
|
|
||||||
|
|
||||||
this._setAsDefaultButtonClickStartTime = Math.floor(Date.now() / 1000);
|
|
||||||
this._setAsDefaultTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
|
||||||
this._setAsDefaultTimer.init(() => {
|
|
||||||
let isDefault = false;
|
|
||||||
let isDefaultError = false;
|
|
||||||
try {
|
|
||||||
isDefault = ShellService.isDefaultBrowser(true, false);
|
|
||||||
} catch (ex) {
|
|
||||||
isDefaultError = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
let now = Math.floor(Date.now() / 1000);
|
|
||||||
let runTime = now - this._setAsDefaultButtonClickStartTime;
|
|
||||||
if (isDefault || runTime > 600) {
|
|
||||||
this._setAsDefaultTimer.cancel();
|
|
||||||
this._setAsDefaultTimer = null;
|
|
||||||
/*
|
|
||||||
Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS")
|
|
||||||
.add(runTime);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
|
|
||||||
.add(isDefaultError);
|
|
||||||
*/
|
|
||||||
}, 1000, Ci.nsITimer.TYPE_REPEATING_SLACK);
|
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
setAsDefaultError = true;
|
setAsDefaultError = true;
|
||||||
Cu.reportError(ex);
|
Cu.reportError(ex);
|
||||||
|
@ -95,7 +95,7 @@ JS_FRIEND_API(JSObject*)
|
|||||||
js::UnwrapOneChecked(JSObject* obj, bool stopAtWindowProxy)
|
js::UnwrapOneChecked(JSObject* obj, bool stopAtWindowProxy)
|
||||||
{
|
{
|
||||||
if (!obj->is<WrapperObject>() ||
|
if (!obj->is<WrapperObject>() ||
|
||||||
MOZ_UNLIKELY(IsWindowProxy(obj) && stopAtWindowProxy))
|
MOZ_UNLIKELY(stopAtWindowProxy && IsWindowProxy(obj)))
|
||||||
{
|
{
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user