mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 10:02:03 -08:00
Misc fixes beta.13
- Fixed some memory enhancement prefs not setting correctly. - Bfcache is now completely disabled. This should improve memory, but kills Playwright's page.go_back() and page.go_forward(). To re-enable this, set `browser.sessionhistory.max_entries` to the amount of pages you want to remember. - Moved SanitizeOnShutdown policy to preferences instead. This unlocks clearOnShutdown preferences. #47 - Added experimental memorysaver property that clears all of the memory after each page.goto navigation. Helpful for datacenters running Camoufox, but could potentially break things. - Cursor now starts in a random position on the screen - Fixed screenshots not capturing the full window when a viewport is set by window.innerWidth and window.innerHeight.
This commit is contained in:
parent
711b5b4550
commit
dc3c0bde16
6 changed files with 481 additions and 447 deletions
|
|
@ -383,7 +383,11 @@ class PageTarget {
|
||||||
this._tab = tab;
|
this._tab = tab;
|
||||||
this._linkedBrowser = tab.linkedBrowser;
|
this._linkedBrowser = tab.linkedBrowser;
|
||||||
this._browserContext = browserContext;
|
this._browserContext = browserContext;
|
||||||
this._viewportSize = undefined;
|
// Set the viewport size to Camoufox's default value.
|
||||||
|
this._viewportSize = {
|
||||||
|
width: ChromeUtils.camouGetInt("window.innerWidth") || 1280,
|
||||||
|
height: ChromeUtils.camouGetInt("window.innerHeight") || 720,
|
||||||
|
};;
|
||||||
this._initialDPPX = this._linkedBrowser.browsingContext.overrideDPPX;
|
this._initialDPPX = this._linkedBrowser.browsingContext.overrideDPPX;
|
||||||
this._url = 'about:blank';
|
this._url = 'about:blank';
|
||||||
this._openerId = opener ? opener.id() : undefined;
|
this._openerId = opener ? opener.id() : undefined;
|
||||||
|
|
@ -570,14 +574,12 @@ class PageTarget {
|
||||||
// Otherwise, explicitly set page viewport prevales over browser context
|
// Otherwise, explicitly set page viewport prevales over browser context
|
||||||
// default viewport.
|
// default viewport.
|
||||||
|
|
||||||
// Do not allow default viewport size if Camoufox set it first
|
// Camoufox is already handling viewport size, so we don't need to set it here.
|
||||||
if (
|
if (
|
||||||
!this._viewportSize &&
|
|
||||||
this._browserContext.defaultViewportSize && (
|
|
||||||
ChromeUtils.camouGetInt("window.outerWidth") ||
|
ChromeUtils.camouGetInt("window.outerWidth") ||
|
||||||
ChromeUtils.camouGetInt("window.outerHeight") ||
|
ChromeUtils.camouGetInt("window.outerHeight") ||
|
||||||
ChromeUtils.camouGetInt("window.innerWidth") ||
|
ChromeUtils.camouGetInt("window.innerWidth") ||
|
||||||
ChromeUtils.camouGetInt("window.innerHeight"))
|
ChromeUtils.camouGetInt("window.innerHeight")
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,17 @@ class PageHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._isDragging = false;
|
this._isDragging = false;
|
||||||
this._lastMousePosition = { x: 0, y: 0 };
|
|
||||||
this._lastTrackedPos = { x: 0, y: 0 };
|
// Camoufox: set a random default cursor position
|
||||||
|
let random_val = (max_val) => Math.floor(Math.random() * max_val);
|
||||||
|
|
||||||
|
// Try to fetch the viewport size
|
||||||
|
this._defaultCursorPos = {
|
||||||
|
x: random_val(this._pageTarget._viewportSize.width),
|
||||||
|
y: random_val(this._pageTarget._viewportSize.height),
|
||||||
|
};
|
||||||
|
this._lastMousePosition = { ...this._defaultCursorPos };
|
||||||
|
this._lastTrackedPos = { ...this._defaultCursorPos };
|
||||||
|
|
||||||
this._reportedFrameIds = new Set();
|
this._reportedFrameIds = new Set();
|
||||||
this._networkEventsForUnreportedFrameIds = new Map();
|
this._networkEventsForUnreportedFrameIds = new Map();
|
||||||
|
|
@ -423,6 +432,14 @@ class PageHandler {
|
||||||
});
|
});
|
||||||
unsubscribe();
|
unsubscribe();
|
||||||
|
|
||||||
|
if (ChromeUtils.camouGetBool('memorysaver', false)) {
|
||||||
|
ChromeUtils.camouDebug('Clearing all memory...');
|
||||||
|
Services.obs.notifyObservers(null, "child-gc-request");
|
||||||
|
Cu.forceGC();
|
||||||
|
Services.obs.notifyObservers(null, "child-cc-request");
|
||||||
|
Cu.forceCC();
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
navigationId: sameDocumentNavigation ? null : navigationId,
|
navigationId: sameDocumentNavigation ? null : navigationId,
|
||||||
};
|
};
|
||||||
|
|
@ -558,8 +575,8 @@ class PageHandler {
|
||||||
// NOTE: since this won't go inside the renderer, there's no need to wait for ACK.
|
// NOTE: since this won't go inside the renderer, there's no need to wait for ACK.
|
||||||
win.windowUtils.sendMouseEvent(
|
win.windowUtils.sendMouseEvent(
|
||||||
'mousemove',
|
'mousemove',
|
||||||
0 /* x */,
|
this._defaultCursorPos.x,
|
||||||
0 /* y */,
|
this._defaultCursorPos.y,
|
||||||
button,
|
button,
|
||||||
clickCount,
|
clickCount,
|
||||||
modifiers,
|
modifiers,
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -14,7 +14,6 @@
|
||||||
"DisableSetDesktopBackground": true,
|
"DisableSetDesktopBackground": true,
|
||||||
"DisableDeveloperTools": false,
|
"DisableDeveloperTools": false,
|
||||||
"NoDefaultBookmarks": true,
|
"NoDefaultBookmarks": true,
|
||||||
"SanitizeOnShutdown": true,
|
|
||||||
"DisableFirefoxScreenshots": true,
|
"DisableFirefoxScreenshots": true,
|
||||||
"DisableSafeMode": true,
|
"DisableSafeMode": true,
|
||||||
"DisplayBookmarksToolbar": "never",
|
"DisplayBookmarksToolbar": "never",
|
||||||
|
|
|
||||||
|
|
@ -82,5 +82,6 @@
|
||||||
{ "property": "webGl2:shaderPrecisionFormats:blockIfNotDefined", "type": "bool" },
|
{ "property": "webGl2:shaderPrecisionFormats:blockIfNotDefined", "type": "bool" },
|
||||||
{ "property": "webGl:contextAttributes", "type": "dict" },
|
{ "property": "webGl:contextAttributes", "type": "dict" },
|
||||||
{ "property": "webGl2:contextAttributes", "type": "dict" },
|
{ "property": "webGl2:contextAttributes", "type": "dict" },
|
||||||
|
{ "property": "memorysaver", "type": "bool" },
|
||||||
{ "property": "debug", "type": "bool" }
|
{ "property": "debug", "type": "bool" }
|
||||||
]
|
]
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
version=130.0.1
|
version=130.0.1
|
||||||
release=beta.12
|
release=beta.13
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue