annotateweb.com is a web annotation and collaboration tool for drawing, highlighting, and commenting on live websites. It requires no installation for the end-user. This repository holds the client-side code for the annotation functionality.
annotateweb.com is a Webfuse Session Extension, not a typical browser extension. Its operation depends on the Webfuse web augmentation platform.
content.js script into this session, granting it access to modify the page.This proxy-based approach means no software or browser extension installation is needed for any user. It also bypasses common browser security policies, permitting augmentation on third-party websites.
The content.js script adds a movable toolbar with several functions.
This section covers the code that provides the annotation functions.
content.js: A Webfuse Session Extension written in JavaScript. It is responsible for:
<canvas> element.browser.webfuseSession.getSessionInfo()) for the “Invite” function.html2canvas.min.js: A third-party library for the “Export to Image” function. It reads the DOM to render a screenshot onto a canvas.
manifest.json: A manifest file defines how the Webfuse platform loads the Session Extension and what permissions it has within the session environment.content.js Implementation DetailsScrolling and Positioning: The script distinguishes between the viewport (visible area) and the document (the entire page). Annotations are drawn on a fixed-position canvas that covers the viewport. The data for each drawing is stored using document-relative coordinates. When a user scrolls, the script clears the viewport canvas and redraws only the annotations that fall within the new visible area.
State Management: Drawing operations are stored in a drawingOperations array. The undo, redo, clear, and export functions operate by manipulating or re-playing the items in this array.
Platform Integration: The script calls browser.webfuseSession.getSessionInfo(). This is a Webfuse API injected into the session. This call retrieves the sessionId, which is a necessary component for creating the collaborative co-browsing link.