Commit Graph

756 Commits

Author SHA1 Message Date
tophf
fcb149ae21 limit broadcast area of prefChanged in notifyAllTabs 2017-04-18 12:46:31 +03:00
tophf
4d143a03dc Apply styles to XML documents 2017-04-18 12:46:31 +03:00
tophf
c061268aeb manage: fix & speedup createStyleElement a bit 2017-04-18 12:46:31 +03:00
tophf
e31def4b8e manage: "(Disabled)" name postfix is now localizable 2017-04-18 12:46:31 +03:00
tophf
f147b409df embed SVG to help buggy Chrome's GC
Chrome doesn't garbage-collect (or even leaks) SVG <symbol> referenced via <use> so we'll embed the code directly on manage and popup pages where dozens/hundreds of svgs are displayed.
2017-04-18 12:46:31 +03:00
tophf
4f5e56bc55 manage: don't flicker newUI sub-options 2017-04-18 12:46:31 +03:00
tophf
e3b461a9e8 manage: add new UI option
* align svg icons to pixel grid
* globalize enforceInputRange() and use it in manage
* 1 installed.onclick instead of 1000+ local ones
2017-04-18 12:46:31 +03:00
tophf
efd3e9ef6c options: use live prefs + reset button 2017-04-18 12:46:30 +03:00
tophf
7f0fd4f6f6 chrome.extension.getURL is deprecated 2017-04-18 12:46:30 +03:00
tophf
f47b1438dd apply: do orphanCheck only on injection 2017-04-18 12:46:30 +03:00
tophf
59899b9395 explicitly use 'window' when getting its properties 2017-04-18 12:46:30 +03:00
tophf
1af1194e9f Declare EntryOnClick as an object: handleEvent 2017-04-18 12:46:30 +03:00
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