Giter VIP home page Giter VIP logo

css-reloader's Introduction

CSS Reloader

CSS Reloader is a browser extension which allows developers to reload CSS without reloading the page itself.

It's currently available for Mozilla Firefox and Google Chrome.

Usage

You can reload all stylesheets via the keyboard shortcut F9, or via the context-menu's option "Reload CSS".

You are able to customize the keyboard shortcut under the extensions settings page.

Installation

Google Chrome

https://chrome.google.com/extensions/detail/dnfpcpfijpdhabaoieccoclghgplmpbd

Firefox

https://addons.mozilla.org/en-US/firefox/addon/css-reloader

Limitations

CSS Reloader isn't reloading stylesheets references by @import (Been looking into this, and there's not easy solution.)

WebExtension

This extension is using a browser polyfil to emulate WebExtensions https://github.com/mozilla/webextension-polyfill

Feedback

Feel free to report issues on GitHub! It's much needed!

== Copyright

Copyright (c) 2017, Kenneth Auchenberg. See LICENSE for details.

css-reloader's People

Contributors

auchenberg avatar bensaufley avatar yfdyh000 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css-reloader's Issues

Failed to change the keyboard shortcut

Error messages from chrome:

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' chrome-extension-resource:".

The code trigger this error is Incssreloader.options.js:24 : var key = eval('"\\u' + keyIdentifier + '"');

Reload doesn't work when blacklist does not exist

If the settings have never been edited the blacklist is undefined and every Reload CSS attempt fails. An error is reported in the Developer Tool console:

Error in event handler for extension.onRequest: TypeError: Cannot read property 'length' of undefined
    at domainIsBlacklisted (chrome-extension://dnfpcpfijpdhabaoieccoclghgplmpbd/cssreloader.content.js:27:48)
    at reload (chrome-extension://dnfpcpfijpdhabaoieccoclghgplmpbd/cssreloader.content.js:15:18)
    at onExtensionRequest (chrome-extension://dnfpcpfijpdhabaoieccoclghgplmpbd/cssreloader.content.js:51:13)

Functionality when freshly installed

Thanks for css-reloader, this is a great tool! 🎉

One small remark/suggestion I'd like to make:
I just installed it for the first time and tried reloading the css on a page that was already loaded before I installed the addon (in firefox by the way) - this did not work. However luckily I gave it another attempt after freshly loading the page and then reloading the css and that worked then.

If this is a known limitation and can't be avoided I would maybe add a small note to the usage section on the add-on page. If css-reloader can be made to work even in the above described scenario all the better! :)

Thank you, keep up the good work! 👍

Firefox - Shortcut does not work when developer tools panel is active

Currently it is not possible to reload CSS using this extension when any of the Firefox developer tools is active. Here's the flow which is severely affected by this issue.

  1. Open web page
  2. F9 to reload CSS
  3. Inspect an element to change its CSS
  4. Alt + Tab switch to editor and change CSS
  5. Alt + Tab switch back to firefox and press F9
  6. CSS should reload but nothing happens

The workaround

after (5) above, click the element (or anywhere on the page), and press F9 to reload CSS.

Feature idea : Cufon integration

I love this module for bringing such a usefull function in a simple keypress. I don't use any cache while developping, and I don't have to reload pages and pages thanks to it.

The only time I have to is when I use Cufon (canvas text replacement script), which while based on CSS for styling, needs a manual refresh with JS if you change this styling.

I tried to put this line :

if( Cufon ) {
Cufon.refresh();
}

in cssreloader.js, but nothing worked after, guess it's not that simple to edit a module.

Huge thanks even if you don't had it !

collision with chrome dev - editing css

Hi nice extension, but it changes the css url address with param (to go trough cache?)
but when in time editing the css in chrome dev tools, with added file in workspace the file is not updated yet. Maybe its conflict. Can be solved in some extension options to not load css with ?params ? (cache can be disabled - and it can works?

Doesn't work locally

Hello!

Thank you for the very useful add-on!

Unfortunately it doesn't work on any of my local websites. I'm using LAMP. Why is that? Can I get it to work?

Option to disable context menu

All my other extensions have an option to remove the Context Menu, so I have a very nice clean right-click and not bloated with a bunch of stuff I do not require.

image

doesn't work on frames

Excellent idea. Unfortunately, I haven't been able to get it to work with frames. It works on a flat file+stylesheet, but not with a simple two frame setup. It reloads any stylesheets associated with the parent document, but not with any child documents. I really don't expect you to provide support for frames, but as some of us are stuck in the 90s, it would be a treat.

In the meantime, I guess I can use the child documents directly.

Firefox/60.0 remaps F9

Firefox/60.0 now maps F9 for Reader View thus it conflicts with CSS Reloader's default short-cut. The short-cut triggers CSS Reloader in some sites (e.g. GitHub) and Reader View in some others (e.g. Firefox 60 Release notes). AFAIK, it depends on whether the browser heuristics determine if the page can be made available in reader mode.

Workaround: change short-cut in add-on preferences¹.

(¹) Any suggestion of a good unused value?

Exclude CDN's from being reloaded

In my webapps I frequently use frameworks (Bootstrap, jQuery UI, AngularUI), which provided the CSS on a CDN.
When developing the application only my own CSS gets changed.
Forcing a reload on the CSS-files from the CDN-server will never return a different file and there only introduces an additional wait.

Enhance the css-reloader with the option to 'blacklist' certain URL's and fill the blacklist with some well known CDN:
ajax.googleapi.com
cdnjs.cloudflare.com
netdna.bootstrapcdn.com
ajax.aspnetcdn.com

Console error due to missing source map

Now and then I get this error in the JavaScript console:

Error en el mapeo fuente: TypeError: NetworkError when attempting to fetch resource.
URL del recurso: moz-extension://50acaf37-b8f3-48d3-99f4-6408e93480ef/browser-polyfill.min.js
URL del mapa fuente: browser-polyfill.min.js.map

I understand it happens because you bundle browser-polyfill.min.js with a link to a source map:

//# sourceMappingURL=browser-polyfill.min.js.map

... but such map is not included.

Incompatable with Firebug

Plugin causes Firefox to crash intermittently while updating style value's from within the firebug console.

F9 doesn't work on Ubuntu 16.04

On the settings page when I push any key I see undefined in keyboard shortcut field

Ubuntu 16.04
Google Chrome 54.0.2840.59 (64-bit)

dont work everywhere

this is message in console
Error in event handler for extension.onRequest: TypeError: Cannot read property 'length' of undefined
at domainIsBlacklisted (chrome-extension://dnfpcpfijpdhabaoieccoclghgplmpbd/cssreloader.content.js:27:48)
at reload (chrome-extension://dnfpcpfijpdhabaoieccoclghgplmpbd/cssreloader.content.js:15:18)
at onExtensionRequest (chrome-extension://dnfpcpfijpdhabaoieccoclghgplmpbd/cssreloader.content.js:51:13)

Chrome/54.0.2840.71

This happend all the time when i try to reload my css in the project.

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.