Coder Social home page Coder Social logo

mrcoles / bookmarklet Goto Github PK

View Code? Open in Web Editor NEW
211.0 211.0 40.0 139 KB

A server-side bookmarklet compiler with greasemonkey userscript-like metadata options and the power of babel and uglify

Home Page: https://www.npmjs.com/package/bookmarklet

License: MIT License

JavaScript 94.27% Shell 5.73%

bookmarklet's People

Contributors

didericis avatar mrcoles avatar nathanathan avatar richardfrost avatar ronnyo avatar rpavlik avatar timcharper avatar vzvu3k6k avatar ytilis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bookmarklet's Issues

ReferenceError: regeneratorRuntime is not defined SOLVED

I am posting for the next unfortunate one who is hoping to find a solution for the regeneratorRuntime issue.
I could be persuaded to submit a PR, but it appears the author has abandoned this project so there is no incentive there.

Here is what I did.

  1. cloned the project
  2. removed all babel dependencies from package.json and code.
  3. replaced "uglify-js" with "terser"
  4. Here is the function that you have to change.
    function minify(code) { return terser.minify(code).code; }

ta-dah. No more questionably useful babel transpilations.

No LICENSE file

Please can you add a LICENSE file to this project. package.json says it is has an MIT license - it would be good to add the text of that to the project to make it clear.

-d option no longer documented in help (plus a typo)

The README in this repo shows that there's a -d option to make a demo page, which is neat. However, when running bookmarklet -h in the terminal, this isn't document. Also there's a spurious ' in the output, after "stdout".

Just found this tool and it looks really helpful, thanks :-).

js-core dependency complains that it needs to be upgraded to js-core 3

When installing the bookmarklet module NPM warns us that the js-core < 3 has a number of issues and should not be used.

EDIT: Confirmed that this is an issue of babel-core and babel-preset-env. There seems to be an outstanding PR to upgrade to a newer version of babel. Possible fix for this?

Low contrast in generated demo page

The feature that generates a demo page is a real time-saver. However, the styling makes the button and the link have very low contrast. The contrast ratio between the white and cyan is just 1.63:1. Depending on screen, environment and visual acuity, it will be hard for some people to see.

The Web Content Accessibility Guidelines (level AA) recommend at least a 3:1 contrast ratio for meaningful graphical elements (i.e. to help people identify the button against its background) and 4.5:1 for text (for the button's label, and the link)—though if the text is considered large this drops to 3:1.

There are some examples of how to improve non-text contrast on W3C's site.

If you're interested, I'd be happy to submit a PR that addresses the contrast issues. Here are two different possibilities...

  1. Simply use a darker colour than the cyan both for the button's background and link text.
  2. Use a darker colour for the link text, keep the cyan for the button's background, but use a darker colour for the button's text and add border.

Further, if you try tabbing through the page, the focus indication is very slight too, because it is using the browser's default, and in some browsers this means it's the same light cyan colour, and quite thin, so is also hard to see. (You can use CSS outline-offset to create a border between the focus outline and the button/link, to make it easier to meet contrast requirements.)

'\w' gets transpiled to 'w'

Source:

console.log('\w');

Expected result:

console.log('\w');

Actual result:

console.log('w');

Thanks & greetings!

Not working on Windows 10

When using this with any code (including running test/run.sh) I am getting the following in the output file:

javascript:(function()%7BNaN%7D)()

Demo page customization

Hi. Awesome job - I used to have to do all that work manually. I haven't been so excited to find a new package like this in months! :)

Have you considered making the demo page customizable? For the sake of simplicity, a key in package.json would be enough.
Being able to provide a name for the bookmarklet to show instead of 'Bookmarklet; would be a great start.
Pointing to a HTML page template would be even better.

I could help out with that.

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.