Commit Graph

118 Commits

Author SHA1 Message Date
tophf
b42dfc8300 fixup bb34538d: decrement styles.length on delete 2018-01-14 15:40:36 +03:00
tophf
eabfaca08e run webNavUsercssInstallerFF on the entire githubusercontent.com
fixes #329
2018-01-14 15:23:09 +03:00
tophf
bb34538da0 smart invalidateCache: try to update filters in-place 2018-01-12 00:54:40 +03:00
tophf
989df35b05 live preview in editor
* refreshAllTabs was extracted
* ...and fixed to use each frame's url when getting the styles
2018-01-12 00:54:36 +03:00
tophf
650cf3521b correctly strip 'code' from style hash 2018-01-10 22:18:35 +03:00
tophf
9fdabe3582 simplify getStyles
* 'asHash' implies 'enabled'
* 'length' is added to the style hash
2018-01-10 22:18:30 +03:00
tophf
bbfda6d33b expose findUsercss 2018-01-09 19:13:37 +03:00
tophf
022e588c97 allow errors in usercss when saving in editor and live-reloading 2018-01-07 16:36:30 +03:00
tophf
87d28d3fc7 silence eslint 2018-01-07 11:52:46 +03:00
tophf
71c3e0c7a8 extract and improve dummy chrome.storage in FF
* chrome.storage.onChanged supported in own pages
* values are stored in the background page
* chrome.storage in own pages accesses that background storage
2018-01-04 17:04:23 +03:00
tophf
2374c88e1b extract styleSectionsEqual 2018-01-04 16:43:54 +03:00
tophf
9be2f942c7 restore default template on saving empty code
fixes 3418ac9c
2018-01-04 16:41:55 +03:00
tophf
1eea8fdbbf fixups for refreshAllTabs 2018-01-03 18:26:31 +03:00
tophf
a572620765 cache icon imageData because the browser doesn't 2018-01-03 10:44:12 +03:00
tophf
3f570c4d3a FF injects content script automatically 2018-01-03 10:44:12 +03:00
tophf
3418ac9cb9 FF: support private/container tabs 2018-01-03 10:43:56 +03:00
tophf
5bc4206593 reuse existing usercss installer tab
A few additional checks were needed to circumvent FF bugs
so openURL was refactored to keep the code readable
2017-12-31 17:59:32 +03:00
tophf
8d9c7acb3c only preserve old style name on update if it was actually customized
We didn't detect that previously and just blindly assumed that a local name is always customized by a user, which is nonsense, obviously. To ensure reliable detection a new property is added to the style object: "originalName". From now on the styles that didn't change their name remotely will be successfully marked as having non-customized names, hence the names will update along with the code. Should be like 99% of styles. As for the remaining 1%, welp, only uninstalling and reinstalling the style anew would switch to the new remote name.
2017-12-13 09:12:54 +03:00
tophf
51ad84e6a9 don't open the homepage on first install as it's not helpful
see #112
2017-12-13 05:35:02 +03:00
tophf
ad692d4f61 chrome.contextMenus.update bug is fixed in Chrome 65.0.3289
#272
2017-12-12 06:20:07 +03:00
tophf
adabb9aeff use LZString alias for LZStringUnsafe 2017-12-11 04:49:59 +03:00
tophf
6fb9d2d157 switch to a much faster LZStringUnsafe
https://github.com/pieroxy/lz-string/pull/98
2017-12-10 11:30:57 +03:00
tophf
405400de68 move 'tempUsercssCode' cleanup to usercss helper 2017-12-10 10:11:18 +03:00
tophf
5d54ce3464 DRY chromeLocal and chromeSync 2017-12-10 10:11:18 +03:00
tophf
42e458ad69 saved.name is absent when checking in manager 2017-12-09 23:27:40 +03:00
tophf
9486c7f3df don't report usercss as installed on USO if homepage matches 2017-12-09 04:43:02 +03:00
tophf
f337e18515 recognize usercss @updateURL
* installation URL is preferred - same behavior as before

* @updateURL is used when the style was drag'n'dropped into the manage page
  because there's no real URL in this case

* install-usercss page shows the new update URL, which is set as per the above,
  under the checkbox that enables updates
2017-12-06 22:35:19 +03:00
tophf
1785bac9d2 fix usercss updater: skip if code hasn't changed 2017-12-04 10:28:24 +03:00
tophf
f4677a7b7b actually use the name when saving 2017-12-03 20:32:50 +03:00
tophf
c11c100cbb circumvent the bug with disabling check marks in Chrome 62+
fixes #272
2017-12-02 16:13:40 +03:00
tophf
7de3e37a51 show "Style installed" in manager for styles added while it's open 2017-12-02 07:07:12 +03:00
tophf
cbe90272b9 silence some useless warnings in console 2017-11-29 17:59:01 +03:00
tophf
ff175d9af4 store installDate and updateDate 2017-11-26 20:47:23 +03:00
tophf
288f347e40 fixup 978e5ca9 and ee86ef30: editor.contextDelete option 2017-11-26 14:20:44 +03:00
tophf
e4de02995c fixup 978e5ca9: don't reuse the same object in async code! 2017-11-26 00:04:19 +03:00
tophf
6aef6cdcd7 0 is a valid tab id 2017-11-25 20:24:15 +03:00
tophf
aedb02bbb1 install usercss from raw.githubusercontent.com 2017-11-25 18:24:37 +03:00
tophf
59d32e6f2f inline and simplify closeTab() 2017-11-25 18:00:41 +03:00
tophf
978e5ca9f0 sendMessage()
Promise mode [default]:
  - rejects on receiving {__ERROR__: message} created by
    background.js::onRuntimeMessage
  - suppresses chrome.runtime.lastError
    by browserAction.setText which lacks a callback param in chrome API

Callback mode:
  - enabled by passing a second param
  - doesn't suppress chrome.runtime.lastError
2017-11-25 18:00:38 +03:00
tophf
8f04e17d27 fix #223 - Android compatibility 2017-11-25 16:25:20 +03:00
tophf
8c5471092c rework install-usercss: CSS, layout, warnings 2017-11-24 13:19:10 +03:00
tophf
00ead83da9 don't hardcode homepage URL, extract it from "Get Help" translation 2017-11-21 09:48:55 +03:00
tophf
fc5c00e37d all actions must always return a Promise 2017-11-15 07:11:46 +03:00
tophf
94ed435e75 fixup d2b9b302: prevent setting version var to 'undefined' 2017-11-14 11:12:18 +03:00
tophf
ac8331e6ae FF: use tabs API for XML viewer 2017-11-14 09:52:51 +03:00
tophf
9503acc2bf styleSectionsEqual() order of sections should be identical
Thus we account for the case of multiple sections matching the same URL because the order of rules is part of cascading
2017-11-14 09:38:09 +03:00
tophf
3c08342e98 open usercss installer tab next to the source tab 2017-11-14 09:38:08 +03:00
tophf
1d463d7820
Merge pull request #134 from eight04/dev-user-css
Install styles from *.user.css file
2017-11-14 08:22:56 +03:00
eight
1dd0dbf907 Revert: isSame/isEdited util 2017-11-09 14:11:25 +08:00
eight
92b01e19e8 Fix: reindent single then 2017-11-09 09:12:03 +08:00