Skip to content

anyshortcut/anyshortcut

Repository files navigation

Anyshortcut

Chrome Web Store Mozilla Add-on license-apache

Forget mouse clicks, embrace shortcuts! Customize keyboard shortcuts for your frequently visited websites.

https://anyshortcut.com

Installation

Contribution

$ git clone git@github.com:anyshortcut/anyshortcut.git
Cloning into 'anyshortcut'...

$ cd anyshortcut

$ tree -L 1  
.
├── README.md
├── build # The Webpack build directory
├── extension # The destination directory build from Webpack for the whole extension.
├── manifest # Generate platform-specific manifest.json respectively.
├── package-lock.json
├── package.json
├── src # The source code directory of Anyshortcut

$ npm install

$ npm run build_production # For Chromium

$ npm run build_production:firefox # For Firefox

The extension/ directory is the destination directory of extension.

Custom build lodash

lodash include command

Reference: https://lodash.com/custom-builds

npm i -g lodash-cli
lodash include=isEmpty,pickBy,extend,escape,cloneDeep,forOwn,forEach,debounce,throttle,sortBy -d -o src/js/vendor/lodash.includes.js

then configure in webpack config file,

resolve: {
    alias: {
        'lodash$': path.join(__dirname, '..', 'src/js/vendor/lodash.includes.js'),
    }
}

Precompile lodash templates to avoid use unsafe-eval

There is an awesome way to precompile templates by custom build.

Use the template command to pass the file path pattern used to match template files to precompile.

Note: Precompiled templates are assigned to the _.templates object.

lodash template="./*.jst"

lodash settings="{variable:'data'}" template="./src/templates/*.html" -d -o src/js/script/templates.js