Skip to content

pRizz/SVG-Navigator---Chrome-Extension

Repository files navigation

SVG Navigator

Description

SVG Navigator is a browser extension that adds pan and zoom features to existing SVG files on the web.

Note

You can access file URLs by going to Chrome's extension settings, and checking "Allow access to file URLs".

Usage

Go to a website with an SVG file. The extension begins working on the SVG graphic and you may:

  • Pan: click and drag or hold the space bar and drag the cursor to pan around the image
  • Zoom in or out: use mouse scroll wheel
  • Zoom: click and drag a zoom box of the desired area if enabled
  • Zoom out: tap alt key
  • Reset zoom: press escape Trying to pan on an SVG by shift click and dragging currently causes undesirable panning; possibly a Google Chrome bug/feature. If you want to view local files with this extension, you must enable "Allow access to file URLs" in Chrome's Extensions view.

Try Testing Out These SVGs

No svg extension pages (e.g. GitHub and PlantUML)

Useful Links

Extension Store Links

Acknowledgements

Concept originally created by Asad Akram, Ryan Oblenida aka Mr. O, and Peter Ryszkiewicz at the Illinois Institute of Technology. Adapted as a Google Chrome extension by Peter Ryszkiewicz. Work was inspired by Kevin Lindsey at http://www.kevlindev.com/index.htm. Illustrations by Cara Stemo.

Build Instructions

Requirements

  • Operating System: Windows, macOS, or Linux
  • Node.js 18.x or later
  • npm 9.x or later
  • pnpm 8.x or later (required package manager)

Installation

  1. Install Node.js and npm from nodejs.org
  2. Install pnpm:
    npm install -g pnpm
  3. Clone the repository:
    git clone https://github.com/pRizz/SVG-Navigator---Chrome-Extension.git
    cd SVG-Navigator---Chrome-Extension
  4. Install dependencies:
    pnpm install

Building

  1. Build the extension:
    pnpm build:all

The built extensions will be available in:

  • Chrome: dist/chrome/
  • Firefox: dist/firefox/
  • Safari: dist/safari/

The packaged extensions will be available in:

  • Chrome: packages/svg-navigator...chrome.zip
  • Firefox: packages/svg-navigator...firefox.xpi
  • Safari: packages/svg-navigator...safari.zip

Development

For development with hot-reload:

  • Chrome:

    pnpm start:chrome
  • Firefox:

    pnpm start:firefox
  • Safari:

    pnpm start:safari

These commands will build the extension and start a development server that watches for changes.

Linting

To run linting:

pnpm lint