init
This commit is contained in:
commit
42ef2f9674
468 files changed
+645161
No files matched your search
+68
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright (c) 2015-present, Facebook, Inc.
|
||||
|
||||
This source code is licensed under the MIT license found in the
|
||||
LICENSE file at
|
||||
https://github.com/facebook/create-react-app/blob/main/LICENSE
|
||||
*/
|
||||
|
||||
/* global Application */
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
function run(argv) {
|
||||
const urlToOpen = argv[0]
|
||||
// Allow requested program to be optional, default to Google Chrome
|
||||
const programName = argv[1] ?? 'Google Chrome'
|
||||
|
||||
const app = Application(programName)
|
||||
|
||||
if (app.windows.length === 0) {
|
||||
app.Window().make()
|
||||
}
|
||||
|
||||
// 1: Looking for tab running debugger then,
|
||||
// Reload debugging tab if found, then return
|
||||
const found = lookupTabWithUrl(urlToOpen, app)
|
||||
if (found) {
|
||||
found.targetWindow.activeTabIndex = found.targetTabIndex
|
||||
found.targetTab.reload()
|
||||
found.targetWindow.index = 1
|
||||
app.activate()
|
||||
return
|
||||
}
|
||||
|
||||
// 2: Looking for Empty tab
|
||||
// In case debugging tab was not found
|
||||
// We try to find an empty tab instead
|
||||
const emptyTabFound = lookupTabWithUrl('chrome://newtab/', app)
|
||||
if (emptyTabFound) {
|
||||
emptyTabFound.targetWindow.activeTabIndex = emptyTabFound.targetTabIndex
|
||||
emptyTabFound.targetTab.url = urlToOpen
|
||||
app.activate()
|
||||
return
|
||||
}
|
||||
|
||||
// 3: Create new tab
|
||||
// both debugging and empty tab were not found make a new tab with url
|
||||
const firstWindow = app.windows[0]
|
||||
firstWindow.tabs.push(app.Tab({ url: urlToOpen }))
|
||||
app.activate()
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup tab with given url
|
||||
*/
|
||||
function lookupTabWithUrl(lookupUrl, app) {
|
||||
const windows = app.windows()
|
||||
for (const window of windows) {
|
||||
for (const [tabIndex, tab] of window.tabs().entries()) {
|
||||
if (tab.url().includes(lookupUrl)) {
|
||||
return {
|
||||
targetTab: tab,
|
||||
targetTabIndex: tabIndex + 1,
|
||||
targetWindow: window,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
@license
|
||||
Rollup.js v4.63.1
|
||||
Fri, 28 Aug 2026 05:58:50 GMT - commit 78bfef0cb94479566f81012fafa372c84b90bd34
|
||||
|
||||
https://github.com/rollup/rollup
|
||||
|
||||
Released under the MIT License.
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
|
||||
require('node:fs/promises');
|
||||
require('node:path');
|
||||
require('node:process');
|
||||
require('node:url');
|
||||
require('./shared/rollup.js');
|
||||
require('./shared/parseAst.js');
|
||||
const loadConfigFile_js = require('./shared/loadConfigFile.js');
|
||||
require('path');
|
||||
require('./native.js');
|
||||
require('node:perf_hooks');
|
||||
require('./getLogFilter.js');
|
||||
|
||||
|
||||
|
||||
exports.loadConfigFile = loadConfigFile_js.loadConfigFile;
|
||||
//# sourceMappingURL=loadConfigFile.js.map
|
||||
Reference in new issue
Block a user