Giter Club home page Giter Club logo

rugk / offline-qr-code Goto Github PK

View Code? Open in Web Editor NEW
385.0 9.0 115.0 4.8 MB

📱 Browser add-on allowing you to quickly generate a QR code offline with the URL of the open tab or other text!

Home Page: https://addons.mozilla.org/firefox/addon/offline-qr-code-generator/?utm_source=github.com&utm_medium=github&utm_content=github-url-description&campaign=github-url-description

License: Other

CSS 1.38% JavaScript 45.75% HTML 52.38% Shell 0.49%
web-extension browser firefox qrcode qrcode-generator add-on browser-addon qr-code offline privacy

offline-qr-code's Introduction

Offline QR Code Generator

Mozilla Add-on version
Mozilla Add-on downloads Mozilla Add-on users Mozilla Add-on stars

This is a (Firefox) add-on (WebExtension) allowing you to generate a QR code from any website and any text.

In contrast to many other add-ons, which use Google Web APIs for that, this add-on works completely offline. This QR code generator puts your privacy first! It does this by working offline, independently of any internet connection! Always.

It has a radically simple, yet powerful interface, allowing you to tweak many things in the settings, but being lightweight when you use it. It's really easy to use! For instance, you can just resize the QR code with your mouse via dragging and dropping. Its lightweight size also makes it fast and easy to install – even on mobile connections.

It is inspired by the old Offline QR code generator add-on for Firefox 56 and lower. This extension only works with modern Firefox versions.

Download

Get it for Firefox!

BTW: If you want to search and insert emojis easily on all your websites, do check out our Awesome Emoji Picker too!

How to support us?

You don't need to be able to write code to support this project! You can e.g. review and like the add-on or this GitHub repo, you can add translations or do documentation tasks.

See the contributing guidelines for more information on how you can help and vote for this browser extension.

In any case, spread the word and recommend it to others! 🤗😍

In action…

showing resizing

See:

Features

  • Puts your privacy first! Privacy is the default here, so it is generating QR codes offline.
  • Follows Firefox Photon Design.
  • Has a simple, but intuitive and usable User Interface.
  • Uses an up-to-date, great and customizable libraries.
  • You can generate and save QR codes as SVG or Canvas (PNG image)!
  • You can choose the size of the QR code and customize things.
  • Is completely internationalized (i18n).
  • You can use a shortcut (Ctrl+Shift+F10) for generating the QR code.
  • Generates QR codes from selected text on the website.
  • Has complete Unicode/UTF-8/Emoji support.
  • Looks good on desktop and mobile devices, i.e. it is responsive!
  • Translated in English and German already. Contribute your own language!
  • Compatible with Firefox for Android
  • Uses up-to-date features and APIs of Firefox for efficient and clean code.
  • Settings are synced across devices with Firefox Sync.
  • Settings can be managed by your administrator. (see issue #177)

Notes

”QR Code” is a registered trademark of DENSO WAVE.

Contribute

You can easily get involved in this FLOSS project and any help is certainly appreciated. Here are some ideas:

Or, in any case, support us by spreading the word! ❤️

offline-qr-code's People

Contributors

ahmadaymana99 avatar anirudh-modi avatar arminjo avatar cgreinhold avatar daaad1 avatar davidfloyd91 avatar devulapallisai avatar dvergeylen avatar ent8r avatar fluoros-jp avatar kinafu avatar mcorwin22 avatar niotw avatar obitech avatar ongspxm avatar oogieboogieinjson avatar paulmburu avatar pradyumnamahajan avatar prometheos2 avatar r3ddingt0n avatar redagavin avatar rizalfakhri avatar rshalman avatar rugk avatar serkanalgur avatar shanirub avatar silltho avatar tamarau avatar thammarith avatar xlomonosvx 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

offline-qr-code's Issues

Alternative new QR code library (with SVG output)

Handling Canvas when re-sizing is not really a nice thing. If we had an SVG QR code library, it may be possibly to do that resizing with a lot less JavaScript and without the need to regenerate the QR code.

Also the SVG could (maybe?) be modified by the JS to apply things like colors.

Size of popup changed in some cases when text is often completly removed and re-added

When you delete all text and only input one letter, delete it again, input again, etc. it often happens that the popup window is re-sized 5px or so for each new "showing" of that window. After some "cycles" it seems to end/to be limited though.
The reason seems to be the placeholder, which is shown and hidden by the JS if everything is removed there.

Actually the underlying problem is, that the whole thing (textarea) jumps/resizes itself when it is hidden. Although the element has it's width and height clearly set (otherwise it would also collapse when no element is inside of it.). Here is a GIF where I just hide it (no other change!):

classvisibilitycausesproblems

It does not matter whether I hide the SVG placeholder or the Canvas, it's both the same.

It even happens, when only the alt text is displayed:
classvisibilitycausesproblemsalttext

It is reproducible in Firefox 60 and without JS:
classvisibilitycausesproblemswithoutjs

Maybe it is also a Firefox bug?

Adjust style of input elements to Firefox ones

Again as about:preferences does it, or, as the Photon styling guide states how it should be done.

This may require quite "much" CSS, but it can partically be taken from the linked photon site.

It should be applied to: checkboxes, radio elements, etc.

Note that it my look strange when it is applied to one element, but not all elements. So it needs to be done for all of them.

May be done in conjunction with #43.

Input text option is not obvious to users

As reported in #37 users may not notice you can enter text there.

Easy steps:

  • Put the GIF showing this feature in a more prominent location.
  • Solve autofocus on Windows (#21), possibly?

More:

  • improve the UI, this needs some ideas (see below)

Ideas

  • changing highlight color?
  • some hint/note even when URL is put into it?
  • some tip on the top?
  • some popup directly near the input field in the form of a speech bubble? (also only shown once after the first starts or so?)
    Problem: This cannot go outside of the actual popup for technical reasons, so it could look a bit strange
  • …?

Improve fetching settings

Currently when used in the popup, most settings are fetched one-by-one, but maybe it would be better to fetch needed ones together and then use them?

This may also need some other changes:

  • they AddonSettings module needs to be adjusted to also be able to accept the syntax the actual sync/managed* fetchers accept, so we can e.g. fetch all settings beginning with "qr" or so. 😃
  • to improve performance maybe fetch the synced settings and the managed ones at the same time, so it does not need to start after the managed setting failed.

"tip of the day"-like feature

Depends on #11.

Maybe in the options and/or popup add a (dissmisable) message bar (info or so) at the top, which shows the user some helpful things or so.

  • It should be displayed randomly, but only 1-3 times or so!
  • Coded in an extensible way, so we can show more "Did you know?" things in the future
  • I'd prefer if it can both be shown in the options and the popup. One does not know what the user actually uses more often.

Settings: Fetch all settings first before showing options

Currently in the settings dialog the thing works like this:

  • It queries the elements by ID, for which a setting needs to be added, and queries each setting for that element.

It would be better if it could do it the other way around:

  • It should get all settings and then look in the DOM for which element it needs to apply it.

BTW saving settings is fine as it is, as they are saved on-demand when a setting is changed, so they need to be saved one-by-one anyway.

Properly log objects

Detect whether a thing to be logged is an object and then log it properly automatically.

This should be done in the Logger of course.

New toolbar button style: Colored

Maybe we can also provide the new icon as a style in addition to the light/dark selection.

Of course, it is the small icon, which has to be adjusted with the same colors laid above it. 😃

Split i18n as it's own library out of project?

So maybe other devs can use it too?

Would need some adjustments, e.g.:

  • detect elements with i18n prefixed attributes (so the i18n does not need to be added in addition to that)
  • maybe fall back to the element itself (e.g. placeholder) when the prefixed version is not used in the source (data-i18n-placeholder). This would make it possible to use the module without these non-JS fallbacks for attributes that are not visible anyway or so…
  • do not hardcode attributes to be searched/replaced
  • maybe a way to add placeholders in the translation?

Allow popup to be resized horzontally when in overflow menu

This (gif from Firefox 60, because Firefox 59 has a min-height or so in that popup, which looks silly):

allowresize

Solution: Remove the height prevention in CSS (.preventScrollbar).

Problem: This is not a good way to do it, because the height prevention has a purpose: If you do have the button as a usual "popup" (i..e not in the overflow menu) we want a maximum height, because if we do not restrict that a scrollbar is shown at some point, which is silly.

Context menu item for converting selected text

Use case: #37

How it should behave:

  1. User selects text.
  2. User right clicks.
  3. User selects "Create QR code from text".
  4. Popup is opened and QR code is shown.

What should not happen:

  • When no text is selected, no context menu entry should be shown. Even an entry "Generate from URL" would be unnecessary as there is the button for that already, which is far easier to be used (as it is only one click away in contrast to a context menu item, which is two clicks away.).

Limit height/do not display vertical scrollbar in popup

When re-sizing the height of the popup, it should not display a scrollbar, it should just limit the height.

heightscrollbar

I have no idea why that does not work like expected. As you can also see in the GIF, when re-sizing the width it does not behave like that.

Extend MessageHandler to set hooks for all types of messages

I think an easy thing to do, would be to adjust the MessageHandler to not only allow showing messages by types, but also setting hooks, which are currently only possible for errors.

What needs to be done?

  • Generalize setErrorHook so it can set hooks for all message types.
  • The function, which is called as the hook, should of course get information about the message type.

Remove about:reader from URL

If you open a page in reader mode, it always mangles with the url and uses the I "internally displayed" one.
I think nobody wants these URLs actually, so we could rewrite them to the "original" URL.

Depends on #61

Default size setting

There should be a setting for the default size:

  • fixed size: (default:) 200px
  • auto-adjust size (automatically choose highest size, e.g. when popup is opened in the overflow menu)
  • remember last size (save size when it is changed in the UI)

If the last setting is selected the value, which can be entered in the "fixed size" setting, should be disabled (of course), but should still show the currently saved value, so when the setting is changed, one directly has the current value.

Ask user before resetting options to default

It may be a good idea to show a warning and ask the user before the settings are reset to the default ones.

I think it may just be implemented with confirm. That's a good easy issue.

Tip: QR code reader on Android

Maybe in the options and/or popup add a (dissmisable) message bar (info or so) at the top, which points the user to some helpful thing about QR codes.

  • It should be displayed randomly, but only 1-3 times or so!, requirement moved to #39
  • Point to https://support.mozilla.org/kb/scan-qr-codes-firefox-android for details.
  • Check platform. (only FF for Android)
  • Coded generally, so we can show more "Did you know?" things in the future requirement moved to #39
  • I'd prefer if it can both be shown in the options and the popup. One does not know what the user actually uses more often. requirement moved to #39

Use AddonSettings for retrieving options in settings pane

When the settings are opened, all options are loaded via plain(-old 😉) browser methods.

However, as we have AddonSettings in the commons.js and we use it in the code anyway, it would be better if we used it here, too. Especially as AddonSettings caches the options and e.g. also the "managed options", which always fail again and again otherwise.

That, however, needs some adjustments in AddonSettings:

  • either a special method or an indicator when returning a setting, whether that setting was a managed option or a "usual" one. (Maybe yet again re-switch to returning an object and store information there?)
    This is needed, because the options page needs to differentiate between these twos.
  • a reset or clearCache method to refetch credentials. Or maybe we can just use the existing loadOptions for that? (I think no, because we better invalidate the existing Promises?)

Hot key for QR code generation/popup

It would be nice to be able to press Ctrl+R or so (preferably customizable) and get the popup open.

In such a case, it should be determinated, whether some text is selected. If it is, it should use that text for the QR code, otherwise just the URL.


If such a thing is possible…

Extend MessageHandler for showing multiple messages

Currently MessageHandler can only show one message.

In the future, it could be necessary to show multiple messages, so these have to be created.

What has to be done?

  • dynamically clone HTML elements
  • maybe get away from IDs in these, as when they are cloned they are not unique anymore, maybe a class may be better

Info button/helper for Error Correction level option

Next to the error correction level there should probably be a link to Wikipedia, which explains what that is, as it is not obvious for the general user.

Maybe an icon, or even better, a helper as they are called in Firefox' design. A small text descripting it in one sentence and link to Wikipedia would be a good thing.

Undo button in reset settings message instead of modal

Background: http://alistapart.com/article/neveruseawarning

So instead of the current modal, we'd be better of by adding a "Undo" button to the confirmation message that the settings were reset.

That button should be the "call to action" button of Firefox' Photons design: https://design.firefox.com/photon/components/message-bars.html#call-to-action

This requires:

  • the settings must be temporarily saved (quite easy, just a "module variable")
  • note that the action button still needs to be implemented

Tip: "You can save QR codes"

Depends on #39

That QR codes can be saved by right-clicking on them, is not really obvious for the user. On the other hand, I want to avoid to having to add code/complexity and a button to the UI to support that feature, which is actually just built-in into Firefox:

Firefox for Android compatibility

Works, but needs multiple (deisgn) adjustments…

E.g.:

  • correct QR code/page width on mobile
  • correct text size in options
  • performance optimization (do not constantly regenerate QR code when entering)
  • hide useless settings in options

Also useful: #3

Warning when settings are low-contrast for QR codes

There should be a warning setting when the contrast of the background/foreground colors is too low. It should say that scanning QR codes with such a low contrast may not be possible.

I guess as one needs to use some color comparison, this issue could be a bit complicated and maybe a new library needs to be introduced. So sharing your ideas before making a PR would be appreciated.

Requires:

  • the warning error message is not completely, so this would need. As with the others, use FF Photon icons.
  • warning message should be shown immediately, but should not block saving the information; i.e. just show it, but
  • warning message may be dismissable or not (I'd rather prefer not, as the warning is obviously always applicable.) If not, it must be shown again when the settings are opened another time, of course.
    Or you could save the dismissable status, but that would be some more work.

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.