uwonbot 1.1.9 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/agent.js +7 -0
package/package.json
CHANGED
package/src/agent.js
CHANGED
|
@@ -93,6 +93,13 @@ async function loadNativeModules() {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
async function getScreenSize() {
|
|
96
|
+
if (platform === 'darwin') {
|
|
97
|
+
try {
|
|
98
|
+
const { stdout } = await execAsync(`osascript -e 'tell application "Finder" to get bounds of window of desktop' 2>/dev/null || osascript -e 'tell application "System Events" to get {0, 0, 1920, 1080}'`);
|
|
99
|
+
const nums = stdout.trim().split(/[,\s]+/).map(Number);
|
|
100
|
+
if (nums.length >= 4) return { width: nums[2], height: nums[3] };
|
|
101
|
+
} catch {}
|
|
102
|
+
}
|
|
96
103
|
if (robot?.screen?.width) {
|
|
97
104
|
const w = await robot.screen.width();
|
|
98
105
|
const h = await robot.screen.height();
|