This repository was archived by the owner on Oct 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
contentEvents/lib/content
eventSimulation/lib/content
mutationEvents/lib/content Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use strict' ;
2+ const registerRunnerModule = require ( '../../../content-register' ) ;
23
3- openRunnerRegisterRunnerModule ( 'assert' , async ( { getModule} ) => {
4+ registerRunnerModule ( 'assert' , async ( { getModule} ) => {
45 const chai = await getModule ( 'chai' ) ;
56 return chai . assert ;
67} ) ;
Original file line number Diff line number Diff line change 11'use strict' ;
22const chai = require ( '../chai' ) ;
3+ const registerRunnerModule = require ( '../../../content-register' ) ;
34
4- openRunnerRegisterRunnerModule ( 'chai' , ( ) => {
5+ registerRunnerModule ( 'chai' , ( ) => {
56 return chai ( ) ;
67} ) ;
Original file line number Diff line number Diff line change 1+ /* global window:false */
2+ 'use strict' ;
3+
4+ const registerRunnerModule = ( ...args ) => {
5+ window . dispatchEvent ( new window . Event ( 'openrunnerinitmoduleframework' ) ) ;
6+ return window . openRunnerRegisterRunnerModule ( ...args ) ;
7+ } ;
8+
9+ module . exports = registerRunnerModule ;
Original file line number Diff line number Diff line change 11/* global window, document */
22'use strict' ;
3-
3+ const registerRunnerModule = require ( '../../../content-register' ) ;
44const log = require ( '../../../../lib/logger' ) ( { hostname : 'content' , MODULE : 'contentEvents/content/index' } ) ;
55
66const SLOW_PAINT_THRESHOLD = 50 ; // 60hz = 16.6...ms
@@ -10,7 +10,7 @@ const SLOW_PAINT_THRESHOLD = 50; // 60hz = 16.6...ms
1010const requestAnimationFrame = callback => window . requestAnimationFrame ( callback ) ;
1111const timing = ( ) => window . performance . timing ;
1212
13- openRunnerRegisterRunnerModule ( 'contentEvents' , async ( { getModule} ) => {
13+ registerRunnerModule ( 'contentEvents' , async ( { getModule} ) => {
1414 const { scriptResult, TimePoint} = await getModule ( 'runResult' ) ;
1515 let lastAnimationFrame = null ;
1616
Original file line number Diff line number Diff line change 22const { click} = require ( './mouse' ) ;
33const { keyboardKeys, keyboardTextInput} = require ( './keyboard' ) ;
44const { focus} = require ( './focus' ) ;
5+ const registerRunnerModule = require ( '../../../content-register' ) ;
56
67const DEFAULT_MOUSE_DOWN_DURATION = 64 ;
78const DEFAULT_KEY_INTERVAL = 10 ;
89const DEFAULT_KEY_DOWN_DURATION = 5 ;
910
10- openRunnerRegisterRunnerModule ( 'eventSimulation' , async ( { getModule} ) => {
11+ registerRunnerModule ( 'eventSimulation' , async ( { getModule} ) => {
1112 const { scriptResult} = await getModule ( 'runResult' ) ;
1213
1314 return Object . freeze ( {
Original file line number Diff line number Diff line change 11'use strict' ;
2+ const registerRunnerModule = require ( '../../../content-register' ) ;
23
3- openRunnerRegisterRunnerModule ( 'expect' , async ( { getModule} ) => {
4+ registerRunnerModule ( 'expect' , async ( { getModule} ) => {
45 const chai = await getModule ( 'chai' ) ;
56 return chai . expect ;
67} ) ;
Original file line number Diff line number Diff line change 11'use strict' ;
22/* global document:false */
3-
43const { observeDocument} = require ( './mutationEvents' ) ;
4+ const registerRunnerModule = require ( '../../../content-register' ) ;
55
6- openRunnerRegisterRunnerModule ( 'mutationEvents' , async ( { getModule} ) => {
6+ registerRunnerModule ( 'mutationEvents' , async ( { getModule} ) => {
77 const { scriptResult} = await getModule ( 'runResult' ) ;
88 observeDocument ( document , scriptResult ) ;
99} ) ;
Original file line number Diff line number Diff line change 11'use strict' ;
2-
32const { transactionAbortedError} = require ( '../../../../lib/scriptErrors' ) ;
43const TimePoint = require ( '../TimePoint' ) ;
54const TimePeriod = require ( '../TimePeriod' ) ;
65const Event = require ( '../Event' ) ;
76const Transaction = require ( '../Transaction' ) ;
87const RunResult = require ( '../RunResult' ) ;
98const log = require ( '../../../../lib/logger' ) ( { hostname : 'content' , MODULE : 'runResult/content/index' } ) ;
9+ const registerRunnerModule = require ( '../../../content-register' ) ;
1010
11- openRunnerRegisterRunnerModule ( 'runResult' , ( { eventEmitter, rpc} ) => {
11+ registerRunnerModule ( 'runResult' , ( { eventEmitter, rpc} ) => {
1212 TimePoint . setCounterFunc ( ( ) => ( {
1313 backgroundCounter : undefined ,
1414 scriptCounter : undefined ,
Original file line number Diff line number Diff line change @@ -86,12 +86,15 @@ try {
8686
8787 window . openRunnerRegisterRunnerModule = openRunnerRegisterRunnerModule ;
8888 window . addEventListener ( 'message' , handleWindowMessage , false ) ;
89- // Workaround for firefox bug (last tested to occur in v57)
89+ // Workaround for firefox bug (last tested to occur in v57 and v65 )
9090 // it seems that sometimes this content script is executed so early that firefox still has to perform some kind of house keeping,
9191 // which causes our global variable to disappear. assigning the global variable again in a microtask works around this bug.
9292 Promise . resolve ( ) . then ( ( ) => {
9393 window . openRunnerRegisterRunnerModule = openRunnerRegisterRunnerModule ;
94- window . addEventListener ( 'message' , handleWindowMessage , false ) ; // has no effect if already added
94+ } ) ;
95+ window . addEventListener ( 'openrunnerinitmoduleframework' , e => {
96+ e . stopImmediatePropagation ( ) ;
97+ window . openRunnerRegisterRunnerModule = openRunnerRegisterRunnerModule ;
9598 } ) ;
9699
97100 log . debug ( 'Initialized... Notifying the background script' ) ;
Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ const Bluefox = require('bluefox');
44
55const log = require ( '../../../../lib/logger' ) ( { hostname : 'content' , MODULE : 'wait/content/index' } ) ;
66const trackRunResultEvents = require ( './trackRunResultEvents' ) ;
7+ const registerRunnerModule = require ( '../../../content-register' ) ;
78
8- openRunnerRegisterRunnerModule ( 'wait' , async ( { eventEmitter, getModule} ) => {
9+ registerRunnerModule ( 'wait' , async ( { eventEmitter, getModule} ) => {
910 const runResultModule = await getModule ( 'runResult' ) ;
1011 const bluefox = new Bluefox ( ) ;
1112 const wait = bluefox . target ( window ) ;
You can’t perform that action at this time.
0 commit comments