Giter VIP home page Giter VIP logo

selector's Introduction

Selector

This is a chrome extension built using chromex and boot. It uses boot chromex sample as a starting point.

Purpose

This lets users bind keybindings to various text selection commands. These are configured from the extension's popup. The various commands available currently are expand-current-selection.

Building

Install the latest Chrome Canary with custom formatters enabled.

Local dev

To build locally open up Emacs and start a Clojure REPL with M-x cider-jack-in. Then from the REPL do:

boot.user=> (def p (future (boot run)))

Now open Chrome Canary and go to the Extensions page. Enable Developer mode and add target/ via "Load unpacked extension...".

The icon to open the popup should appear next to the address bar.

Popup REPL

To start a REPL that will connect to the popup from Emacs right click on the icon and select "Inspect Popup". Go to the sources page of Developer Tools and open popup.html in a new tab.

Now back at the Clojure REPL:

boot.user=> (start-repl)

If this does not connect refresh the popup page. Now we're connected!

Production

From a terminal window do:

$ boot production

Load the extension by adding target/ via "Load unpacked extension..." to test the extension. Finally use Chrome's "Pack extension" tool to prepare the final package (.crx and .pem files)

Code Overview

Util

There is code for storage and selection in src/util. storage.cljs uses the Chromex Storage API to facilitate communication between the content script and popup, and selection.cljs contains code to extend the current text selection.

Content Script

The content script, the code that is injected into the page, is located in src/content_script. This sets up a keyboard listener and when there is a match alters the current text selection using code from the selection namespace.

Popup

The popup code located in src/popup is for setting and getting the data from the popup.

Roadmap

  • Add customizable selections
  • Support for more complex keybindings

selector's People

Contributors

vijumathew avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.