Set Brave as Default Browser from Command Line / / No Comments I’ve been a huge fan of the Brave web browser for years. They’re crypto-friendly, provide native ad-blocking features, and even provide Tor integration. Whenever I set up new systems, I automate Brave as the default browser. You can use the following shell command to set Brave as the default browser: open -a "Brave Browser" --args --make-default-browser Brave has been an excellent browser with a progressive outlook web browsing. I recommend everyone use Brave! The post Set Brave as Default Browser from Command Line appeared first on David Walsh Blog. David Walsh Blog… more → Posted in: JavaScript Tagged with: Brave, browser, Command, default, from, line
CSS :autofill / / No Comments Autofilling HTML input elements is a frequent user action that can drastically improve user experience. Hell, we all autofill for our passwords and address information. But what control do we have when input elements have been autofilled? To add custom CSS styles to inputs whose contents have been autofilled by the browser, you can use the :autofill pseudo-class: input:autofill { border: 2px solid orange; } I’m really happy that browsers allow site and app developers to customize the styling of elements that have been changed by the browser. Autofill, to a degree, is an unnatural act, so signaling to that the value in an input was changed without control is important. Since different... more → Posted in: JavaScript Tagged with: autofill
Building a Web View of a Public Google Drive Folder / / No Comments I’m working on a project to help with local initiatives and as part of that effort, I needed to look into creating a nice way to display, make available, etc., files stored in Google Drive. Google Drive lets you make a folder public, and to be honest, the interface isn’t too hard to use. I’ve got a folder you can open yourself at https://drive.google.com/drive/folders/1FYLaoscxWBV_BU5sFouf7XCrv7cKktBY?usp=sharing. Here’s how it looks if you don’t want to click. Raymond Camden… more → Posted in: JavaScript Tagged with: building, Drive, Folder, Google, public, View
How to Inject a Global with Web Extensions in Manifest V3 / / No Comments For those of you not familiar with the world of web extension development, a storm is brewing with Chrome. Google will stop support for manifest version 2, which is what the vast majority of web extensions use. Manifest version 3 sees many changes but the largest change is moving from persistent background scripts to service workers. This…is…a…massive…change. Changes from manifest version 2 to version 3 include: Going from persistent background script to a service worker that can die after 5 minutes No use of <iframe elements or other DOM APIs from the service worker All APIs have become Promise-based Restrictions on content from a CSP perspective One function that... more → Posted in: JavaScript Tagged with: Extensions, global, Inject, Manifest
Using Google Maps with Alpine.js / / No Comments It’s been a little while since I’ve blogged about Alpine.js, and I thought an example of integratingGoogle Maps with it would be a good way to continue my path to becoming comfortable with the framework. I imagined it would be fairly simple, but in building a few demos I ran into some interesting issues that helped me learn a bit more about Alpine. Let’s take a look. Raymond Camden… more → Posted in: JavaScript Tagged with: Alpine.js, Google, maps, using
CSS :out-of-range / / No Comments One aspect of web development I’ve always loathed was working with forms. Form elements have been traditionally difficult to style due to OS and browser differences, and validation can be a nightmare. Luckily the native HTML APIs added methods for improving the form validation situation. With input[type=number] elements, you can add min and max attributes. Those attributes are great but the browser doesn’t display distinct error styles if those numbers are out of range. Luckily we have :out-of-range: /* matches when number is not within min and max */ input[type=number]:out-of-range { border-color: red; } Thanks to CSS :out-of-range, developers can style input elements based... more → Posted in: JavaScript Tagged with: outofrange
Monitor Events and Function Calls via Console / / No Comments Despite having worked on the very complex Firefox for a number of years, I’ll always love plain old console.log debugging. Logging can provide an audit trail as events happen and text you can share with others. Did you know that chrome provides monitorEvents and monitor so that you can get a log each time an event occurs or function is called? Monitor Events Pass an element and a series of events to monitorEvents to get a console log when the event happens: // Monitor any clicks within the window monitorEvents(window, 'click') // Monitor for keyup and keydown events on the body monitorEvents(document.body, ['keyup', 'keydown']) You can pass an array of events to listen for multiple... more → Posted in: JavaScript Tagged with: Calls, Console, events, Function, Monitor
Investigating IndexedDB Wrapper Libraries – Part Three / / No Comments Welcome to the third and final (for now) entry into my series looking at wrapper libraries for working with IndexedDB. I began this series earlier this month demonstrating a simple Contacts database implemented with IndexedDB. In the second entry, I demonstrated how the Dexie library made working with IndexedDB much simpler. Today I’m going to look at my last "planned" entry (I may revisit this again if I find more) in this series – using DPP, or Deep Persistent Proxy Objects for JavaScript. Raymond Camden… more → Posted in: JavaScript Tagged with: IndexedDB, investigating, libraries, part, three, Wrapper