@quadient/skillshare 0.1.0 → 0.1.1
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/dist/index.js +14 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1032,11 +1032,21 @@ async function openBrowser(url) {
|
|
|
1032
1032
|
return;
|
|
1033
1033
|
}
|
|
1034
1034
|
if (process.platform === 'win32') {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1035
|
+
for (const [command, args] of [
|
|
1036
|
+
['explorer.exe', [url]],
|
|
1037
|
+
['rundll32.exe', ['url.dll,FileProtocolHandler', url]],
|
|
1038
|
+
]) {
|
|
1039
|
+
try {
|
|
1040
|
+
const result = await runProcess(command, args, { allowFailure: true });
|
|
1041
|
+
if (result.exitCode === 0) {
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
catch {
|
|
1046
|
+
// Try the next opener.
|
|
1047
|
+
}
|
|
1038
1048
|
}
|
|
1039
|
-
|
|
1049
|
+
throw new Error('Failed to open browser.');
|
|
1040
1050
|
}
|
|
1041
1051
|
const result = await runProcess('xdg-open', [url], { allowFailure: true });
|
|
1042
1052
|
if (result.exitCode !== 0) {
|