Changeset View
Changeset View
Standalone View
Standalone View
extension/content-script.js
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 68 | if (items.mpris.enabled) { | |||
|---|---|---|---|---|---|
| 72 | } | 72 | } | ||
| 73 | } | 73 | } | ||
| 74 | }); | 74 | }); | ||
| 75 | 75 | | |||
| 76 | // BREEZE SCROLL BARS | 76 | // BREEZE SCROLL BARS | ||
| 77 | // ------------------------------------------------------------------------ | 77 | // ------------------------------------------------------------------------ | ||
| 78 | // | 78 | // | ||
| 79 | function loadBreezeScrollBars() { | 79 | function loadBreezeScrollBars() { | ||
| 80 | if (!IS_FIREFOX) { | 80 | if (IS_FIREFOX) { | ||
| 81 | var linkTag = document.createElement("link"); | 81 | return; | ||
| 82 | linkTag.rel = "stylesheet"; | 82 | } | ||
| 83 | linkTag.href = chrome.extension.getURL("breeze-scroll-bars.css"); | 83 | | ||
| 84 | (document.head || document.documentElement).appendChild(linkTag); | 84 | if (!document.head) { | ||
| 85 | return; | ||||
| 86 | } | ||||
| 87 | | ||||
| 88 | // You cannot access cssRules for <link rel="stylesheet" ..> on a different domain. | ||||
| 89 | // Since our chrome-extension:// URL for a stylesheet would be, this can | ||||
| 90 | // lead to problems in e.g modernizr, so include the <style> inline instead. | ||||
| 91 | // "Failed to read the 'cssRules' property from 'CSSStyleSheet': Cannot access rules" | ||||
| 92 | var styleTag = document.createElement("style"); | ||||
| 93 | styleTag.appendChild(document.createTextNode(` | ||||
| 94 | ::-webkit-scrollbar { | ||||
| 95 | /* we'll add padding as "border" in the thumb*/ | ||||
| 96 | height: 20px; | ||||
| 97 | width: 20px; | ||||
| 98 | background: white; | ||||
| 99 | } | ||||
| 100 | | ||||
| 101 | ::-webkit-scrollbar-track { | ||||
| 102 | border-radius: 20px; | ||||
| 103 | border: 7px solid white; /* FIXME why doesn't "transparent" work here?! */ | ||||
| 104 | background-color: white; | ||||
| 105 | width: 6px !important; /* 20px scrollbar - 2 * 7px border */ | ||||
| 106 | box-sizing: content-box; | ||||
| 85 | } | 107 | } | ||
| 108 | ::-webkit-scrollbar-track:hover { | ||||
| 109 | background-color: #BFC0C2; | ||||
| 110 | } | ||||
| 111 | | ||||
| 112 | ::-webkit-scrollbar-thumb { | ||||
| 113 | background-color: #3DAEE9; /* default blue breeze color */ | ||||
| 114 | border: 7px solid transparent; | ||||
| 115 | border-radius: 20px; | ||||
| 116 | background-clip: content-box; | ||||
| 117 | width: 6px !important; /* 20px scrollbar - 2 * 7px border */ | ||||
| 118 | box-sizing: content-box; | ||||
| 119 | min-height: 30px; | ||||
| 120 | } | ||||
| 121 | ::-webkit-scrollbar-thumb:window-inactive { | ||||
| 122 | background-color: #949699; /* when window is inactive it's gray */ | ||||
| 123 | } | ||||
| 124 | ::-webkit-scrollbar-thumb:hover { | ||||
| 125 | background-color: #93CEE9; /* hovered is a lighter blue */ | ||||
| 126 | } | ||||
| 127 | | ||||
| 128 | ::-webkit-scrollbar-corner { | ||||
| 129 | background-color: white; /* FIXME why doesn't "transparent" work here?! */ | ||||
| 130 | } | ||||
| 131 | `)); | ||||
| 132 | | ||||
| 133 | document.head.appendChild(styleTag); | ||||
| 86 | } | 134 | } | ||
| 87 | 135 | | |||
| 88 | 136 | | |||
| 89 | // MPRIS | 137 | // MPRIS | ||
| 90 | // ------------------------------------------------------------------------ | 138 | // ------------------------------------------------------------------------ | ||
| 91 | // | 139 | // | ||
| 92 | 140 | | |||
| 93 | // we give our transfer div a "random id" for privacy | 141 | // we give our transfer div a "random id" for privacy | ||
| ▲ Show 20 Lines • Show All 554 Lines • Show Last 20 Lines | |||||