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.

Chrome Extension: Adding Context menus

Paul Kinlan

This post concludes the "Buzz This" Chrome Extension series by demonstrating how to add context menus. Context menus provide a powerful way to interact with users, letting them "Buzz" specific content like images or selected text, rather than the entire page. This is achieved by adding "contextMenus" to the permissions in the manifest file and then using chrome.contextMenus.create() in the background.html file. The create() method takes an object that defines the context menu's title, contexts (e.g., "page", "selection", "image", "link"), and an onclick event handler. The click handler determines the context of the click (selected text, image, link) and constructs the Buzz API URL accordingly. The code for the extension is available on GitHub.

Read More