forked from microsoft/playwright
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
browser(firefox-stable): roll Firefox to 104.0
References microsoft#16780
- Loading branch information
1 parent
ad46e98
commit 8772296
Showing
11 changed files
with
257 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
1346 | ||
Changed: yurys@chromium.org Mon Aug 22 16:56:24 PDT 2022 | ||
1347 | ||
Changed: lushnikov@chromium.org Tue 23 Aug 2022 03:05:32 PM PDT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
REMOTE_URL="https://github.com/mozilla/gecko-dev" | ||
BASE_BRANCH="release" | ||
BASE_REVISION="f532fa26bc150add9f8ba42e5fbfdbeffa23662f" | ||
BASE_REVISION="fd854580ffc6fba6a0acdf335c96a1b24b976cb9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
var EXPORTED_SYMBOLS = ["Juggler", "JugglerFactory"]; | ||
|
||
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); | ||
const {ComponentUtils} = ChromeUtils.import("resource://gre/modules/ComponentUtils.jsm"); | ||
const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm"); | ||
const {Dispatcher} = ChromeUtils.import("chrome://juggler/content/protocol/Dispatcher.js"); | ||
const {BrowserHandler} = ChromeUtils.import("chrome://juggler/content/protocol/BrowserHandler.js"); | ||
const {NetworkObserver} = ChromeUtils.import("chrome://juggler/content/NetworkObserver.js"); | ||
const {TargetRegistry} = ChromeUtils.import("chrome://juggler/content/TargetRegistry.js"); | ||
const {Helper} = ChromeUtils.import('chrome://juggler/content/Helper.js'); | ||
const helper = new Helper(); | ||
|
||
const Cc = Components.classes; | ||
const Ci = Components.interfaces; | ||
|
||
const FRAME_SCRIPT = "chrome://juggler/content/content/main.js"; | ||
|
||
let browserStartupFinishedCallback; | ||
let browserStartupFinishedPromise = new Promise(x => browserStartupFinishedCallback = x); | ||
|
||
class Juggler { | ||
get classDescription() { return "Sample command-line handler"; } | ||
get classID() { return Components.ID('{f7a74a33-e2ab-422d-b022-4fb213dd2639}'); } | ||
get contractID() { return "@mozilla.org/remote/juggler;1" } | ||
get QueryInterface() { | ||
return ChromeUtils.generateQI([ Ci.nsICommandLineHandler, Ci.nsIObserver ]); | ||
} | ||
get helpInfo() { | ||
return " --juggler Enable Juggler automation\n"; | ||
} | ||
|
||
handle(cmdLine) { | ||
// flag has to be consumed in nsICommandLineHandler:handle | ||
// to avoid issues on macos. See Marionette.jsm::handle() for more details. | ||
// TODO: remove after Bug 1724251 is fixed. | ||
cmdLine.handleFlag("juggler-pipe", false); | ||
} | ||
|
||
// This flow is taken from Remote agent and Marionette. | ||
// See https://github.com/mozilla/gecko-dev/blob/0c1b4921830e6af8bc951da01d7772de2fe60a08/remote/components/RemoteAgent.jsm#L302 | ||
async observe(subject, topic) { | ||
switch (topic) { | ||
case "profile-after-change": | ||
Services.obs.addObserver(this, "command-line-startup"); | ||
Services.obs.addObserver(this, "browser-idle-startup-tasks-finished"); | ||
break; | ||
case "command-line-startup": | ||
Services.obs.removeObserver(this, topic); | ||
const cmdLine = subject; | ||
const jugglerPipeFlag = cmdLine.handleFlag('juggler-pipe', false); | ||
if (!jugglerPipeFlag) | ||
return; | ||
|
||
this._silent = cmdLine.findFlag('silent', false) >= 0; | ||
if (this._silent) { | ||
Services.startup.enterLastWindowClosingSurvivalArea(); | ||
browserStartupFinishedCallback(); | ||
} | ||
Services.obs.addObserver(this, "final-ui-startup"); | ||
break; | ||
case "browser-idle-startup-tasks-finished": | ||
browserStartupFinishedCallback(); | ||
break; | ||
// Used to wait until the initial application window has been opened. | ||
case "final-ui-startup": | ||
Services.obs.removeObserver(this, topic); | ||
|
||
const targetRegistry = new TargetRegistry(); | ||
new NetworkObserver(targetRegistry); | ||
|
||
const loadFrameScript = () => { | ||
Services.mm.loadFrameScript(FRAME_SCRIPT, true /* aAllowDelayedLoad */); | ||
if (Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo).isHeadless) { | ||
const styleSheetService = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService); | ||
const ioService = Cc["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); | ||
const uri = ioService.newURI('chrome://juggler/content/content/hidden-scrollbars.css', null, null); | ||
styleSheetService.loadAndRegisterSheet(uri, styleSheetService.AGENT_SHEET); | ||
} | ||
}; | ||
|
||
// Force create hidden window here, otherwise its creation later closes the web socket! | ||
Services.appShell.hiddenDOMWindow; | ||
|
||
let pipeStopped = false; | ||
let browserHandler; | ||
const pipe = Cc['@mozilla.org/juggler/remotedebuggingpipe;1'].getService(Ci.nsIRemoteDebuggingPipe); | ||
const connection = { | ||
QueryInterface: ChromeUtils.generateQI([Ci.nsIRemoteDebuggingPipeClient]), | ||
receiveMessage(message) { | ||
if (this.onmessage) | ||
this.onmessage({ data: message }); | ||
}, | ||
disconnected() { | ||
if (browserHandler) | ||
browserHandler['Browser.close'](); | ||
}, | ||
send(message) { | ||
if (pipeStopped) { | ||
// We are missing the response to Browser.close, | ||
// but everything works fine. Once we actually need it, | ||
// we have to stop the pipe after the response is sent. | ||
return; | ||
} | ||
pipe.sendMessage(message); | ||
}, | ||
}; | ||
pipe.init(connection); | ||
const dispatcher = new Dispatcher(connection); | ||
browserHandler = new BrowserHandler(dispatcher.rootSession(), dispatcher, targetRegistry, () => { | ||
if (this._silent) | ||
Services.startup.exitLastWindowClosingSurvivalArea(); | ||
connection.onclose(); | ||
pipe.stop(); | ||
pipeStopped = true; | ||
}, () => browserStartupFinishedPromise); | ||
dispatcher.rootSession().setHandler(browserHandler); | ||
loadFrameScript(); | ||
dump(`\nJuggler listening to the pipe\n`); | ||
break; | ||
} | ||
} | ||
|
||
} | ||
|
||
const jugglerInstance = new Juggler(); | ||
|
||
// This is used by the XPCOM codepath which expects a constructor | ||
var JugglerFactory = function() { | ||
return jugglerInstance; | ||
}; | ||
|
18 changes: 18 additions & 0 deletions
18
browser_patches/firefox/juggler/components/components.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
Classes = [ | ||
# Juggler | ||
{ | ||
"cid": "{f7a74a33-e2ab-422d-b022-4fb213dd2639}", | ||
"contract_ids": ["@mozilla.org/remote/juggler;1"], | ||
"categories": { | ||
"command-line-handler": "m-remote", | ||
"profile-after-change": "Juggler", | ||
}, | ||
"jsm": "chrome://juggler/content/components/Juggler.js", | ||
"constructor": "JugglerFactory", | ||
}, | ||
] | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.