Commit Graph

844 Commits

Author SHA1 Message Date
tophf
2875bb77d0 moz-import: trim empty lines at section start/end 2017-04-18 12:46:30 +03:00
tophf
0ceff44000 manage: use svg icons in messageBox() 2017-04-18 12:46:30 +03:00
tophf
8b2226936d popup: make the regexp problem indicator red 2017-04-18 12:46:30 +03:00
tophf
fa550d1ee6 manage: center the update status message vertically 2017-04-18 12:46:29 +03:00
tophf
071a4d6f26 applyStyleState: use a separate cache for disabled styles 2017-04-18 12:46:29 +03:00
tophf
494b23e3fd manage: add an ID to entries 2017-04-18 12:46:29 +03:00
tophf
ee93f8a876 Set openerTabId to return to original tab on closing 2017-04-18 12:46:29 +03:00
tophf
3d163df853 manage: open external links with openURL() 2017-04-18 12:46:29 +03:00
tophf
1cf904b135 polish popup/manage/edit css/svg/etc.
* restore the correct width of svg icons
* popup: use the standard formatting & SVG <symbol>
* popup .breadcrumbs hover highlight
* manage: black links, transitions; use <p> in #options; trim .homepage
* edit: move regexp tester info link to a template
2017-04-18 12:46:29 +03:00
tophf
67e606c3d5 SVG icon fixup: invoke onclick() directly 2017-04-18 12:46:29 +03:00
tophf
3c5cc141c4 manage: make #find-editor-styles a link; remove global options
* "Find styles" is a link so we make it one, just like in the popup.
* We have a dedicated global options UI so it makes no sense to subset only two of them on the manage page, moreover both options are unrelated to managing styles.
2017-04-18 12:46:29 +03:00
tophf
c32e968f63 Restore sync for popupWidth; mirror all prefs in localStorage; 2017-04-18 12:46:28 +03:00
tophf
26802e36df Optimize startup: coalesce & debounce prefs.set
Previously prefs.set broadcast many messages per each changed pref value to all open tabs, background page, popups. This lead to repeated and needless updates of various things like the toolbar icon, reapplying of styles, and whatnot. It could easily take more than 100ms on an average computer with many tabs open.

Now we debounce the broadcast & sync.set and coalesce all values in one object which is then sent just once per destination.
2017-04-18 12:46:28 +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
4bc7b55b91 apply.js: a bad typo caused ghosts to linger 2017-04-18 12:46:28 +03:00
tophf
1bf23046d5 updateIcon: code cosmetics 2017-04-18 12:46:28 +03:00
tophf
db8526b50b In Vivaldi setBadgeText must follow setBadgeBackgroundColor 2017-04-18 12:46:28 +03:00
tophf
3876ffc671 Preserve selection/cursor after beautify-css 2017-04-18 12:46:28 +03:00
tophf
668e3a7b56 ignoreChromeError -> messaging; use it in editor's menu update 2017-04-18 12:46:27 +03:00
tophf
e384657668 Use our beautify-css-mod.js with more options 2017-04-18 12:46:27 +03:00
tophf
a0d50fecf7 beautify-css.js: override step 2, add our options 2017-04-18 12:46:27 +03:00
tophf
746dd02f39 beautify-css.js: override step 1, copy 2017-04-18 12:46:27 +03:00
tophf
1fcac0ddf4 beautify-css.js: 1.6.12 2017-04-18 12:46:27 +03:00
tophf
1cfd2752d5 Revert "Add more options to beautify-css.js" 2017-04-18 12:46:27 +03:00
tophf
6be903e2ad Add UI for 'editor.matchHighlight' option 2017-04-18 12:46:27 +03:00
tophf
c4f219c039 Use our match-highlighter.js mod that reveals only multiple matches 2017-04-18 12:46:26 +03:00
tophf
6265951d01 match-highlighter.js: override step 2, highlight only multiple matches 2017-04-18 12:46:26 +03:00
tophf
3fb41a17e3 match-highlighter.js: override step 1 2017-04-18 12:46:26 +03:00
tophf
7ba276a821 regexp tester: autoupdate on tab navigations 2017-04-18 12:46:26 +03:00
tophf
c356fb9be5 Add regexp tester to the editor 2017-04-18 12:46:26 +03:00
tophf
486d4258d3 Reinject styles on document-rewrite
uBlock-extra rewrites html of some sites known to have bad scripts. Such new documentElement doesn't have our styles so we need to detect this case by observing the parent document node non-recursively, meaning we don't add overhead to the normal browsing experience.
2017-04-18 12:46:26 +03:00
tophf
e4c8ff9ff1 TEMPORARY: restore style elements removed by hostile sites 2017-04-18 12:46:26 +03:00
tophf
1c2c14d231 Correctly omit @namespace-only code in popup + speed up 2017-04-18 12:46:26 +03:00
tophf
7d9a6b5a3f OptionsUI: add 2 global options + simplify
* [x] show badge with active styles count
* [x] styles on top in the popup
* Simplify since we use a persistent background page so it's always there for us
2017-04-18 12:46:25 +03:00
tophf
4dd8066ca4 OptionsUI: restructure html, make it userstylable 2017-04-18 12:46:25 +03:00
tophf
0c6b74d999 Apply styles to more iframes
Previously we incorrectly assumed that each sub-element is present in addedNodes array, but actually we need to inspect each added node's children e.g. using the superfast getElementsByTagName.
2017-04-18 12:46:25 +03:00
tophf
4be9dc0413 fixup f7659343: getStyles is callback-based, not return-based 2017-04-18 12:46:25 +03:00
tophf
64c830caa9 webNavigation.onReferenceFragmentUpdated instead of tabs.onUpdated
Also send a Do-It-Yourself to our built-in pages to fetch the styles directly which is faster because IPC messaging JSON-ifies everything internally
2017-04-18 12:46:25 +03:00
tophf
d32ad30f8f webNavigation.getFrame may return null on overridden pages, fix a3401b05 2017-04-18 12:46:25 +03:00
tophf
54ab65989d Simplify configureCommands; focus an existing tab
Instead of isolating the deoptimization trigger:
https://github.com/petkaantonov/bluebird/wiki/Optimization-killers
2017-04-18 12:46:25 +03:00
tophf
55ac677d85 manage: fixup style search 2017-04-18 12:46:24 +03:00
tophf
2fb046e996 manage: import/update/add maintains sort order 2017-04-18 12:46:24 +03:00
tophf
b09b77d198 break-word for style name in manage/messagebox 2017-04-18 12:46:24 +03:00
tophf
9a36acf045 Center messageBox icon vertically in the title 2017-04-18 12:46:24 +03:00
tophf
1166fd9d3b openURL fix for opera:// URLs 2017-04-18 12:46:24 +03:00
tophf
a2ea1bb1d9 openURL: handle urls with # 2017-04-18 12:46:24 +03:00
tophf
4a642f77a5 Cache last 100 getDomains for filterStyles 2017-04-18 12:46:24 +03:00
tophf
78c56352cb Cache compiled regexps 2017-04-18 12:46:24 +03:00
tophf
2ef87e003d Remove webSqlStorage cruft as Stylus never used it 2017-04-18 12:46:23 +03:00
tophf
ac4a420e2b ESLint: customize the rules; fix the issues 2017-04-18 12:46:23 +03:00