kbenson / urlswitcher-deno Goto Github PK
View Code? Open in Web Editor NEWSimple program to load a specific browser based on URL characteristics
License: GNU General Public License v3.0
Simple program to load a specific browser based on URL characteristics
License: GNU General Public License v3.0
When running the compiled application I was seeing a very brief terminal window flash and no browser would launch. Running by hand produced the following output. Note the use of --allow-all to rule out any permissions issues from deno itself. This is Windows saying no.
C:\Users\username\Downloads\urlswitcher-deno-main\urlswitcher-deno-main> deno run --allow-all .\main.ts https://www.google.com
Testing match /://..example.com/
Testing match regexp(://..example.net)
firefox work
[ '"C:\Program Files\Mozilla Firefox\firefox.exe"', "https://www.google.com" ]
error: Uncaught PermissionDenied: Access is denied. (os error 5)
const r = Deno.run({ cmd: commandAry });
^
at Object.opSync (deno:core/01_core.js:149:12)
at opRun (deno:runtime/js/40_process.js:27:17)
at Object.run (deno:runtime/js/40_process.js:114:17)
at file:///C:/Users/username/Downloads/urlswitcher-deno-main/urlswitcher-deno-main/main.ts:101:16
When writing out .urlswitcher.ini the unbounded spaces in the file bothered me so I put them in quotes:
# urlswitch.ini
[default]
browser = firefox work
[firefox work]
command = "C:\Program Files\Mozilla Firefox\firefox.exe"
match[] = regexp(://.*\.example.com)
match[] = regexp(://.*\example.net)
[chrome personal]
command = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
Removing the quotes removed the error and solved the problem. Might be worth adding a comment line in the example file warning against this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.