Hello.

I am Paul Kinlan.

A Developer Advocate for Chrome and the Open Web at Google.

I love the web. The web should allow anyone to access any experience that they need without the need for native install or content walled garden.

Building a simple PubSub system in JavaScript

Paul Kinlan

In this post, I share a simple client-side JavaScript PubSub system I built. Motivated by the Not-Invented-Here syndrome and the desire for independent UI components, I created a lightweight event manager called EventManager. It allows components to communicate without direct dependencies by publishing and subscribing to named events. While similar to tools like Redux, this approach avoids separate state management, leveraging the browser's existing state. The code is available on GitHub.

Read More

Measuring the impact of autofill on your forms

Paul Kinlan

Measuring the impact of autofill is crucial. In WebKit/Blink browsers, the -webkit-autofill pseudo-class helps track autofill, but it's not supported in Firefox. I've found a workaround in Firefox using the input event, checking for the absence of keyboard interaction. Ideally, a standardized :autofill pseudo-class and a dedicated onautocomplete event would simplify this process, allowing developers to measure and manage autofill effectively.

Read More

Waiting for an element to be created

Paul Kinlan

In my quest to understand how to detect when a field has been autofilled, I needed a way to monitor the events of an element that doesn't exist yet. I created a helper function, waitForElement, that uses MutationObserver to wait for an element with a specific ID to be added to the DOM. Once the element is added, the promise resolves and returns the element. This, combined with my previously created monitorEvents function, allows me to start logging events on dynamically created elements, getting me closer to solving the autofill detection puzzle.

Read More

Monitor all Events on an Element

Paul Kinlan

I needed to figure out how to monitor events on an element (like when a field is autofilled) and Chrome DevTools has a monitorEvents function, but Firefox doesn't. Since I couldn't find an equivalent in Firefox DevTools, I created my own JavaScript function that iterates through an element's properties, finds event listeners (e.g., "onclick"), extracts the event name (e.g., "click"), and attaches a console logger to each event. The code snippet and a corresponding gist are provided.

Read More

Hypothetically Speaking

Paul Kinlan

This blog post asks readers for their opinion on including event announcements related to blog post topics. For example, if a post is about Apple Macs, I wonder if readers would like to know about Mac Expos. Similarly, for a post about World War 2, it asks if announcing related events like commemoration days would be useful. Readers are invited to share their thoughts in the comments or via email.

Read More

Worker Threads in JavaScript?

Paul Kinlan

I'm exploring ways to implement continuous polling of a resource and event dispatching based on its state in JavaScript. Are worker threads, or something similar, achievable in JavaScript? Currently, timer-based triggers seem like the most viable option. Is this an acceptable approach, or are there more efficient and appropriate alternatives?

Read More

Follow up to Start.com entry

Paul Kinlan

I previously complained about a click-related bug on Start.com. I'm pleased to report that the Start.com team responded to my email, explaining they're overloaded but plan to fix the issue by replacing the "mouse down" event with a "mouse up" event. I'm happy with their response. Here are links to my previous posts about this issue.

Read More