Commit Graph

26 Commits

Author SHA1 Message Date
tophf
346245a847 code cosmetics: simplify importFromString a bit 2017-04-18 12:47:23 +03:00
tophf
a2faa9398a style backup: +revokeObjectURL +MIME-type 2017-04-18 12:47:23 +03:00
tophf
1651d52776 Construct DOM via $element instead of HTML string 2017-04-18 12:47:23 +03:00
tophf
e6f2034e64 make import report messages localizable 2017-04-18 12:46:36 +03:00
tophf
4f2ccbe6cb speedup import by bulk-updating DOM every 50 styles or 1 sec 2017-04-18 12:46:35 +03:00
tophf
5c8d1950a7 Isolate storage.js in background context
To prevent cross-page leaks we need to create/copy prefs and cachedStyles inside the background page context.

* storage.js is now used only in the background page

* messaging.js now contains less bg-specific methods and more common methods. Added saveStyleSafe, deleteStyleSafe which automatically invoke onRuntimeMessage of the current page or just handleUpdate/handleDelete when notify:false

* prefs.js with 'prefs' for background and UI pages: separate objects because a UI page may load before the background page and it can read prefs from localStorage/sync/defaults
2017-04-18 12:46:34 +03:00
tophf
b61dc4184b fixup: import report onclick 2017-04-18 12:46:33 +03:00
tophf
f8d13d8dec Remove code:false mode; show sloppy regexps in popup
* Now that our own pages retrieve the styles directly via getStylesSafe the only 0.001% of cases where code:false would be needed (the browser is starting up with some of the tabs showing our built-in pages like editor or manage) is not worth optimizing for.

* According to CSS4 @document specification the entire URL must match. Stylish-for-Chrome implemented it incorrectly since the very beginning. We detect styles that abuse the bug by finding the sections that would have been applied by Stylish but not by us as we follow the spec. Additionally we'll check for invalid regexps.
2017-04-18 12:46:28 +03:00
tophf
ac4a420e2b ESLint: customize the rules; fix the issues 2017-04-18 12:46:23 +03:00
tophf
363f752934 Use messageBox in manage for confirm; partially revert c5741aff 2017-04-18 12:46:23 +03:00
tophf
4936426fa3 dom.js: extract common DOM functions 2017-04-18 12:46:22 +03:00
tophf
8bcd7f60c5 Restore implicit handleUpdate in saveStyle 2017-04-18 12:46:22 +03:00
tophf
b1c19bdf3d Import styles: show report with Undo button 2017-04-18 12:46:22 +03:00
tophf
c1338e63d1 Highlight updated/saved style in manage page 2017-04-18 12:43:30 +03:00
tophf
2f4da37fdb Refactor and speed up popup & manager
Popup:
* Enforce 200-800px range for the popup width option

Manage:
* faster search via cachedStyles.byId
* faster restoration of search results on history nav
* style name is clickable and opens the editor
* animated highlight of style element on update/add/save
* expandable extra applies-to targets
* remember scroll position on normal history navigation
* boz-sizing in #header, also in editor
* applies-to targets use structured markup
* get*Tab*, enableStyle and deleteStyle are promisified
2017-04-18 12:43:29 +03:00
tophf
08509b8cc2 Support file drag-n-drop on the entire manage page 2017-03-16 13:32:13 +03:00
tophf
d49622dd27 Make exported styles JSON human-readable by indenting 2017-03-16 13:32:12 +03:00
tophf
38006847f7 Don't apply styles until import is finished 2017-03-16 13:32:12 +03:00
Jeremy Schomery
ac967ace5e fixes https://github.com/schomery/stylish-chrome/issues/13#issuecomment-284582600 2017-03-08 11:43:35 +03:30
Jeremy Schomery
fb45e86648 fixes #13 2017-03-06 18:15:49 +03:30
Jeremy Schomery
f8fc82cae7 code cleanup; fileSaveLoad.js 2017-02-05 09:55:44 +03:30
Jeremy Schomery
fbfaa969b5 fixes time generation function 2017-02-05 09:45:44 +03:30
Jeremy Schomery
a13bce4673 Removing moment.js dependency 2017-02-05 09:41:23 +03:30
Jeremy Schomery
b07cf590b9 restyling backup/fileSaveLoad.js 2017-02-03 12:54:47 +03:30
Jeremy Schomery
92d0acfbe3 fixes #11 2017-02-03 12:47:26 +03:30
narcolepticinsomniac
7904cf9b6f Add files via upload 2017-01-30 14:02:50 -05:00