Merge pull request #46 from Aenigma/feature/logo-update
Odysee Logo + Local Badges
2
.gitignore
vendored
|
@ -2,3 +2,5 @@
|
||||||
dist
|
dist
|
||||||
node_modules
|
node_modules
|
||||||
web-ext-artifacts
|
web-ext-artifacts
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||

|

|
||||||
# Watch on LBRY
|
# Watch on LBRY
|
||||||
|
|
||||||
A plugin for web browsers that brings more utility for LBRY Protocol by allowing you to find people you watch on YouTube that are availible on LBRY.tv/Odysee/Desktop App and other LBRY Protocol based apps/websites, allows you to easly check your subscribtion list and much more!
|
A plugin for web browsers that brings more utility for LBRY Protocol by allowing you to find people you watch on YouTube that are availible on LBRY.tv/Odysee/Desktop App and other LBRY Protocol based apps/websites, allows you to easly check your subscribtion list and much more!
|
||||||
|
@ -9,7 +9,8 @@ This plugin is using LBRY Inc YouTube Sync API to check if video fot synchronize
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
[](https://addons.mozilla.org/en/firefox/addon/watch-on-lbry/?src=search) [](https://chrome.google.com/webstore/detail/watch-on-lbry/jjmbbhopnjdjnpceiecihldbhibchgek)
|
[](https://addons.mozilla.org/en/firefox/addon/watch-on-lbry/?src=search)
|
||||||
|
[](https://chrome.google.com/webstore/detail/watch-on-lbry/jjmbbhopnjdjnpceiecihldbhibchgek)
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ Pull requests are welcome. For major changes, please open an issue first to disc
|
||||||
Please make sure to update tests as appropriate.
|
Please make sure to update tests as appropriate.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
[GPL-3.0 License](https://choosealicense.com/licenses/gpl-3.0/)
|
[GPL-3.0 License](LICENSE)
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
|
|
BIN
doc/img/AMO-button_1.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
doc/img/chrome-small-border.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
151
src/icons/lbry/odysee-logo.svg
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
id="Layer_1"
|
||||||
|
data-name="Layer 1"
|
||||||
|
viewBox="0 0 103.3 103.3"
|
||||||
|
version="1.1"
|
||||||
|
sodipodi:docname="Logo_Textless_Vector.svg"
|
||||||
|
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
|
||||||
|
width="103.3"
|
||||||
|
height="103.3">
|
||||||
|
<metadata
|
||||||
|
id="metadata340">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title>odysee_</dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1025"
|
||||||
|
id="namedview338"
|
||||||
|
showgrid="false"
|
||||||
|
showguides="false"
|
||||||
|
inkscape:zoom="3.18"
|
||||||
|
inkscape:cx="191"
|
||||||
|
inkscape:cy="51.650002"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="Layer_1" />
|
||||||
|
<defs
|
||||||
|
id="defs293">
|
||||||
|
<style
|
||||||
|
id="style278">.cls-1{fill:url(#linear-gradient);}.cls-2{fill:#fff;}.cls-3{fill:none;}.cls-4{fill:#f9f9f9;}</style>
|
||||||
|
<linearGradient
|
||||||
|
id="linear-gradient"
|
||||||
|
x1="37.900002"
|
||||||
|
y1="5.54"
|
||||||
|
x2="110.84"
|
||||||
|
y2="180.14999"
|
||||||
|
gradientUnits="userSpaceOnUse"
|
||||||
|
gradientTransform="translate(-9,-8.3499985)">
|
||||||
|
<stop
|
||||||
|
offset="0"
|
||||||
|
stop-color="#ef1970"
|
||||||
|
id="stop280" />
|
||||||
|
<stop
|
||||||
|
offset="0.14"
|
||||||
|
stop-color="#f23b5c"
|
||||||
|
id="stop282" />
|
||||||
|
<stop
|
||||||
|
offset="0.44"
|
||||||
|
stop-color="#f77d35"
|
||||||
|
id="stop284" />
|
||||||
|
<stop
|
||||||
|
offset="0.7"
|
||||||
|
stop-color="#fcad18"
|
||||||
|
id="stop286" />
|
||||||
|
<stop
|
||||||
|
offset="0.89"
|
||||||
|
stop-color="#fecb07"
|
||||||
|
id="stop288" />
|
||||||
|
<stop
|
||||||
|
offset="1"
|
||||||
|
stop-color="#ffd600"
|
||||||
|
id="stop290" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<title
|
||||||
|
id="title295">odysee_</title>
|
||||||
|
<circle
|
||||||
|
class="cls-1"
|
||||||
|
cx="51.650002"
|
||||||
|
cy="51.650002"
|
||||||
|
r="51.650002"
|
||||||
|
id="circle297"
|
||||||
|
style="fill:url(#linear-gradient)" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 11.92,38.220002 a 0.95,0.95 0 1 0 -0.3,1.31 0.95,0.95 0 0 0 0.3,-1.31"
|
||||||
|
id="path299" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 67.44,13.370002 a 0.95,0.95 0 1 0 -0.3,1.31 0.95,0.95 0 0 0 0.3,-1.31"
|
||||||
|
id="path301" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 78.91,50.650002 a 1.11,1.11 0 1 0 1.33,-0.84 1.11,1.11 0 0 0 -1.33,0.84"
|
||||||
|
id="path303" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 62.35,87.650002 a 0.86,0.86 0 1 0 1,-0.65 0.86,0.86 0 0 0 -1,0.65"
|
||||||
|
id="path305" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 19.18,21.160002 a 0.52,0.52 0 1 0 0.63,-0.39 0.52,0.52 0 0 0 -0.63,0.39"
|
||||||
|
id="path307" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 21.86,69.960002 a 0.73,0.73 0 1 0 -0.59,0.85 0.73,0.73 0 0 0 0.59,-0.85"
|
||||||
|
id="path309" />
|
||||||
|
<path
|
||||||
|
class="cls-3"
|
||||||
|
d="m 43.75,10.140002 c 0,0 -8.16,2.24 -7.53,10.89 0.56,7.67 4.65,11.85 13.14,8.65 8.49,-3.2 9.93,-5.45 7.85,-11.85 -2.08,-6.4 -4.49,-10.7300005 -13.46,-7.69 z"
|
||||||
|
id="path311" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 91.45,83.650002 c -0.32,-0.6 -6.45,-10 -7.21,-17.9 -0.56,-5.47 -7.71,-11.54 -12,-14.73 a 3.11,3.11 0 0 1 -0.24,-4.75 c 4.23,-4 11.69,-11.8 14.05,-15.92 a 31.3,31.3 0 0 0 3.44,-13.89 51.89,51.89 0 0 0 -9.82,-8.2200005 c -3.48,1.72 -4.42,7.0700005 -5.95,13.3000005 -2.08,8.49 -7,7.53 -9,7.53 -2,0 -0.8,-3 -5.45,-16.34 C 54.62,-0.60999847 42.53,2.7300015 33.34,8.2300015 21.66,15.230002 26.87,30.160002 29.76,39.780002 c -1.64,1.58 -7.81,2.81 -13.42,5.83 -6.95,3.74 -14.06,9.75 -15.91,12.51 a 51.33,51.33 0 0 0 2.62,11 5.89,5.89 0 0 0 1.38,0.95 c 3.29,1.53 8.13,-1.09 12.71,-5.84 a 23.33,23.33 0 0 1 4.57,-3.53 48.94,48.94 0 0 1 11.77,-5.53 c 0,0 4.49,6.89 8.65,15.06 4.16,8.17 -4.49,10.89 -5.45,10.89 -0.96,0 -14.59,-1.27 -11.55,10.26 3.04,11.529998 19.7,7.37 28.19,1.76 8.49,-5.61 6.41,-23.87 6.41,-23.87 8.33,-1.28 10.89,7.53 11.69,12 0.8,4.47 -1,12.33 7.37,12.5 a 10.48,10.48 0 0 0 3.47,-0.54 51.94,51.94 0 0 0 8.74,-8.17 2.88,2.88 0 0 0 0.45,-1.41 z m -42.09,-54 c -8.49,3.2 -12.58,-1 -13.14,-8.65 -0.63,-8.65 7.53,-10.89 7.53,-10.89 9,-3.0000005 11.37,1.28 13.46,7.69 2.09,6.41 0.64,8.68 -7.85,11.85 z"
|
||||||
|
id="path313" />
|
||||||
|
<polygon
|
||||||
|
class="cls-2"
|
||||||
|
points="97.44,50.39 96.27,48.07 93.72,47.54 96.04,46.37 96.56,43.82 97.74,46.14 100.29,46.66 97.97,47.84 "
|
||||||
|
id="polygon315"
|
||||||
|
transform="translate(-9,-8.3499985)" />
|
||||||
|
<path
|
||||||
|
class="cls-4"
|
||||||
|
d="m 54.25,19.360002 a 5.41,5.41 0 0 1 0.38,3.6"
|
||||||
|
id="path329" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 54.63,24.060002 h -0.21 a 1.09,1.09 0 0 1 -0.86,-1.27 4.36,4.36 0 0 0 -0.31,-3 1.09,1.09 0 0 1 2,-0.84 6.46,6.46 0 0 1 0.44,4.23 1.09,1.09 0 0 1 -1.06,0.88 z"
|
||||||
|
id="path331" />
|
||||||
|
<path
|
||||||
|
class="cls-4"
|
||||||
|
d="m 51.56,13.330002 a 6.14,6.14 0 0 1 0.81,1.24"
|
||||||
|
id="path333" />
|
||||||
|
<path
|
||||||
|
class="cls-2"
|
||||||
|
d="m 52.36,15.650002 a 1.09,1.09 0 0 1 -1,-0.56 6.71,6.71 0 0 0 -0.64,-1 1.1,1.1 0 0 1 0,-1.52 1.07,1.07 0 0 1 1.49,0 6.8,6.8 0 0 1 1,1.49 1.09,1.09 0 0 1 -0.85,1.59 z"
|
||||||
|
id="path335" />
|
||||||
|
</svg>
|
After Width: | Height: | Size: 5.5 KiB |
1
src/icons/wol/default-monochrome-black.svg
Normal file
After Width: | Height: | Size: 5.2 KiB |
1
src/icons/wol/default-monochrome-white.svg
Normal file
After Width: | Height: | Size: 5.2 KiB |
1
src/icons/wol/default-transparent.svg
Normal file
After Width: | Height: | Size: 5.7 KiB |
1
src/icons/wol/default.svg
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
src/icons/wol/icon128.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
src/icons/wol/icon16.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
src/icons/wol/icon48.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
1
src/icons/wol/isolated-layout.svg
Normal file
After Width: | Height: | Size: 5.2 KiB |
1
src/icons/wol/isolated-monochrome-black.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg data-v-423bf9ae="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 422.10743801652893 60" class="font"><!----><!----><!----><g data-v-423bf9ae="" id="c68be61a-7a4c-407d-aedb-150928d6ca02" fill="black" transform="matrix(6.347107410430908,0,0,6.347107410430908,0.2727353870868683,0.0743802934885025)" style="--darkreader-inline-fill:#000000;" data-darkreader-inline-fill=""><path d="M4.02 0.41C3.98 0.18 3.75 0 3.53 0L3.22 0C3.00 0 2.77 0.18 2.73 0.41L2.00 4.66L1.36 0.42C1.32 0.18 1.09 0 0.85 0L0.45 0C0.13 0-0.08 0.27-0.04 0.57L1.33 9.02C1.37 9.24 1.58 9.44 1.82 9.44L2.13 9.44C2.35 9.44 2.58 9.25 2.62 9.03L3.37 4.56L4.12 9.03C4.16 9.25 4.38 9.44 4.61 9.44L4.93 9.44C5.17 9.44 5.39 9.24 5.43 9.02L6.78 0.57C6.82 0.27 6.58 0 6.27 0L5.87 0C5.63 0 5.39 0.18 5.36 0.42L4.73 4.63ZM11.66 9.04C11.72 9.25 11.94 9.44 12.15 9.44L12.56 9.44C12.89 9.44 13.12 9.14 13.05 8.82L11.12 0.39C11.07 0.18 10.84 0 10.63 0L10.32 0C10.11 0 9.88 0.18 9.83 0.39L8.55 5.87L7.88 8.83C7.81 9.16 8.04 9.44 8.37 9.44L8.78 9.44C8.99 9.44 9.21 9.25 9.27 9.04L9.76 6.86L11.19 6.86ZM10.47 3.23C10.74 4.42 10.71 4.80 10.86 5.47L10.08 5.47ZM12.60 0.88C12.60 1.16 12.82 1.39 13.10 1.39L14.24 1.39L14.24 8.92C14.24 9.20 14.46 9.42 14.74 9.42L15.12 9.42C15.40 9.42 15.62 9.20 15.62 8.92L15.62 1.39L16.77 1.39C17.05 1.39 17.28 1.16 17.28 0.88L17.28 0.49C17.28 0.21 17.05-0.01 16.77-0.01L13.10-0.01C12.82-0.01 12.60 0.21 12.60 0.49ZM17.58 6.69C17.58 7.80 17.89 8.44 18.33 8.88C18.79 9.32 19.36 9.44 19.89 9.44C20.40 9.44 20.99 9.32 21.45 8.88C21.88 8.44 22.18 7.80 22.18 6.69L22.18 6.50C22.18 6.22 21.95 5.99 21.69 5.99L21.28 5.99C21 5.99 20.78 6.22 20.78 6.50L20.78 6.69C20.78 7.20 20.71 7.57 20.54 7.80C20.41 7.94 20.16 8.05 19.89 8.05C19.29 8.05 19.00 7.63 19.00 6.69L19.00 2.73C19.00 1.79 19.31 1.39 19.89 1.39C20.47 1.39 20.78 1.79 20.78 2.73L20.78 2.93C20.78 3.21 21 3.43 21.28 3.43L21.69 3.43C21.95 3.43 22.18 3.21 22.18 2.93L22.18 2.73C22.18 1.67 21.88 0.97 21.43 0.55C20.97 0.13 20.41 0 19.89 0C19.36 0 18.80 0.13 18.34 0.55C17.89 0.97 17.58 1.67 17.58 2.73ZM24.53 4.03L24.53 0.50C24.53 0.22 24.30 0 24.02 0L23.63 0C23.35 0 23.13 0.22 23.13 0.50L23.13 8.93C23.13 9.21 23.35 9.44 23.63 9.44L24.02 9.44C24.30 9.44 24.53 9.21 24.53 8.93L24.53 5.42L26.08 5.42L26.08 8.93C26.08 9.21 26.31 9.44 26.59 9.44L26.98 9.44C27.26 9.44 27.48 9.21 27.48 8.93L27.48 0.50C27.48 0.22 27.26 0 26.98 0L26.59 0C26.31 0 26.08 0.22 26.08 0.50L26.08 4.03ZM31.58 6.69C31.58 7.80 31.89 8.44 32.33 8.88C32.79 9.32 33.38 9.44 33.88 9.44C34.40 9.44 34.99 9.32 35.45 8.88C35.88 8.44 36.18 7.80 36.18 6.69L36.18 2.73C36.18 0.95 35.42 0 33.88 0C32.35 0 31.58 0.97 31.58 2.73ZM32.98 2.73C32.98 1.82 33.26 1.39 33.88 1.39C34.48 1.39 34.78 1.79 34.78 2.73L34.78 6.69C34.78 7.64 34.47 8.05 33.88 8.05C33.28 8.05 32.98 7.62 32.98 6.69ZM41.40 9.44C41.68 9.44 41.90 9.21 41.90 8.93L41.90 0.50C41.90 0.22 41.68 0 41.40 0L41.01 0C40.73 0 40.50 0.22 40.50 0.50L40.50 5.12L38.56 0.31C38.50 0.15 38.28 0 38.09 0L37.76 0C37.49 0 37.25 0.22 37.25 0.50L37.25 8.93C37.25 9.21 37.49 9.44 37.76 9.44L38.16 9.44C38.43 9.44 38.67 9.21 38.67 8.93L38.67 4.31L40.61 9.13C40.67 9.28 40.91 9.44 41.08 9.44ZM49.84 8.55C49.84 8.27 49.62 8.05 49.34 8.05L47.25 8.05L47.25 0.50C47.25 0.22 47.03 0 46.76 0L46.35 0C46.07 0 45.85 0.22 45.85 0.50L45.85 8.93C45.85 9.21 46.07 9.44 46.35 9.44L49.34 9.44C49.62 9.44 49.84 9.21 49.84 8.93ZM52.61 9.44C54.25 9.44 54.98 8.54 54.98 6.73C54.98 5.88 54.74 5.17 54.38 4.72L54.38 4.72C54.38 4.72 54.98 4.00 54.98 2.70C54.98 0.90 54.25 0 52.61 0L51.23 0C50.95 0 50.72 0.22 50.72 0.50L50.72 8.93C50.72 9.21 50.95 9.44 51.23 9.44ZM52.61 1.39C53.30 1.39 53.58 1.76 53.58 2.70C53.58 3.64 53.30 4.02 52.61 4.02L52.12 4.02L52.12 1.39ZM52.61 5.40C53.30 5.40 53.58 5.78 53.58 6.73C53.58 7.67 53.30 8.05 52.61 8.05L52.12 8.05L52.12 5.40ZM60.55 6.58C60.55 5.85 60.35 5.28 59.95 4.84C59.99 4.80 60.02 4.77 60.06 4.73C60.49 4.30 60.65 3.60 60.65 2.73C60.65 0.85 60.05-0.01 58.32-0.01L56.56-0.01C56.28-0.01 56.06 0.21 56.06 0.49L56.06 8.92C56.06 9.20 56.28 9.42 56.56 9.42L56.95 9.42C57.22 9.42 57.44 9.20 57.44 8.92L57.44 5.49L58.07 5.49C58.76 5.49 59.15 5.88 59.15 6.58L59.15 8.92C59.15 9.20 59.37 9.42 59.65 9.42L60.05 9.42C60.33 9.42 60.55 9.20 60.55 8.92ZM57.44 1.39L58.32 1.39C59.05 1.39 59.26 1.78 59.26 2.73C59.26 3.68 58.86 4.07 58.07 4.07L57.44 4.07ZM62.78 0.29C62.72 0.15 62.48 0 62.31 0L61.87 0C61.47 0 61.25 0.35 61.40 0.70C62.01 2.10 62.62 3.49 63.22 4.89L63.22 8.93C63.22 9.21 63.45 9.44 63.71 9.44L64.11 9.44C64.39 9.44 64.61 9.21 64.61 8.93L64.61 4.90L66.42 0.70C66.56 0.35 66.33 0 65.95 0L65.49 0C65.34 0 65.10 0.15 65.03 0.29L63.91 2.87Z"></path></g><!----><!----></svg>
|
After Width: | Height: | Size: 4.5 KiB |
1
src/icons/wol/isolated-monochrome-white.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg data-v-423bf9ae="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 422.10743801652893 60" class="font"><!----><!----><!----><g data-v-423bf9ae="" id="7ded7196-cb33-41a9-a3d2-8b6b37ca65cf" fill="white" transform="matrix(6.347107410430908,0,0,6.347107410430908,0.2727353870868683,0.0743802934885025)" style="--darkreader-inline-fill:#181a1b;" data-darkreader-inline-fill=""><path d="M4.02 0.41C3.98 0.18 3.75 0 3.53 0L3.22 0C3.00 0 2.77 0.18 2.73 0.41L2.00 4.66L1.36 0.42C1.32 0.18 1.09 0 0.85 0L0.45 0C0.13 0-0.08 0.27-0.04 0.57L1.33 9.02C1.37 9.24 1.58 9.44 1.82 9.44L2.13 9.44C2.35 9.44 2.58 9.25 2.62 9.03L3.37 4.56L4.12 9.03C4.16 9.25 4.38 9.44 4.61 9.44L4.93 9.44C5.17 9.44 5.39 9.24 5.43 9.02L6.78 0.57C6.82 0.27 6.58 0 6.27 0L5.87 0C5.63 0 5.39 0.18 5.36 0.42L4.73 4.63ZM11.66 9.04C11.72 9.25 11.94 9.44 12.15 9.44L12.56 9.44C12.89 9.44 13.12 9.14 13.05 8.82L11.12 0.39C11.07 0.18 10.84 0 10.63 0L10.32 0C10.11 0 9.88 0.18 9.83 0.39L8.55 5.87L7.88 8.83C7.81 9.16 8.04 9.44 8.37 9.44L8.78 9.44C8.99 9.44 9.21 9.25 9.27 9.04L9.76 6.86L11.19 6.86ZM10.47 3.23C10.74 4.42 10.71 4.80 10.86 5.47L10.08 5.47ZM12.60 0.88C12.60 1.16 12.82 1.39 13.10 1.39L14.24 1.39L14.24 8.92C14.24 9.20 14.46 9.42 14.74 9.42L15.12 9.42C15.40 9.42 15.62 9.20 15.62 8.92L15.62 1.39L16.77 1.39C17.05 1.39 17.28 1.16 17.28 0.88L17.28 0.49C17.28 0.21 17.05-0.01 16.77-0.01L13.10-0.01C12.82-0.01 12.60 0.21 12.60 0.49ZM17.58 6.69C17.58 7.80 17.89 8.44 18.33 8.88C18.79 9.32 19.36 9.44 19.89 9.44C20.40 9.44 20.99 9.32 21.45 8.88C21.88 8.44 22.18 7.80 22.18 6.69L22.18 6.50C22.18 6.22 21.95 5.99 21.69 5.99L21.28 5.99C21 5.99 20.78 6.22 20.78 6.50L20.78 6.69C20.78 7.20 20.71 7.57 20.54 7.80C20.41 7.94 20.16 8.05 19.89 8.05C19.29 8.05 19.00 7.63 19.00 6.69L19.00 2.73C19.00 1.79 19.31 1.39 19.89 1.39C20.47 1.39 20.78 1.79 20.78 2.73L20.78 2.93C20.78 3.21 21 3.43 21.28 3.43L21.69 3.43C21.95 3.43 22.18 3.21 22.18 2.93L22.18 2.73C22.18 1.67 21.88 0.97 21.43 0.55C20.97 0.13 20.41 0 19.89 0C19.36 0 18.80 0.13 18.34 0.55C17.89 0.97 17.58 1.67 17.58 2.73ZM24.53 4.03L24.53 0.50C24.53 0.22 24.30 0 24.02 0L23.63 0C23.35 0 23.13 0.22 23.13 0.50L23.13 8.93C23.13 9.21 23.35 9.44 23.63 9.44L24.02 9.44C24.30 9.44 24.53 9.21 24.53 8.93L24.53 5.42L26.08 5.42L26.08 8.93C26.08 9.21 26.31 9.44 26.59 9.44L26.98 9.44C27.26 9.44 27.48 9.21 27.48 8.93L27.48 0.50C27.48 0.22 27.26 0 26.98 0L26.59 0C26.31 0 26.08 0.22 26.08 0.50L26.08 4.03ZM31.58 6.69C31.58 7.80 31.89 8.44 32.33 8.88C32.79 9.32 33.38 9.44 33.88 9.44C34.40 9.44 34.99 9.32 35.45 8.88C35.88 8.44 36.18 7.80 36.18 6.69L36.18 2.73C36.18 0.95 35.42 0 33.88 0C32.35 0 31.58 0.97 31.58 2.73ZM32.98 2.73C32.98 1.82 33.26 1.39 33.88 1.39C34.48 1.39 34.78 1.79 34.78 2.73L34.78 6.69C34.78 7.64 34.47 8.05 33.88 8.05C33.28 8.05 32.98 7.62 32.98 6.69ZM41.40 9.44C41.68 9.44 41.90 9.21 41.90 8.93L41.90 0.50C41.90 0.22 41.68 0 41.40 0L41.01 0C40.73 0 40.50 0.22 40.50 0.50L40.50 5.12L38.56 0.31C38.50 0.15 38.28 0 38.09 0L37.76 0C37.49 0 37.25 0.22 37.25 0.50L37.25 8.93C37.25 9.21 37.49 9.44 37.76 9.44L38.16 9.44C38.43 9.44 38.67 9.21 38.67 8.93L38.67 4.31L40.61 9.13C40.67 9.28 40.91 9.44 41.08 9.44ZM49.84 8.55C49.84 8.27 49.62 8.05 49.34 8.05L47.25 8.05L47.25 0.50C47.25 0.22 47.03 0 46.76 0L46.35 0C46.07 0 45.85 0.22 45.85 0.50L45.85 8.93C45.85 9.21 46.07 9.44 46.35 9.44L49.34 9.44C49.62 9.44 49.84 9.21 49.84 8.93ZM52.61 9.44C54.25 9.44 54.98 8.54 54.98 6.73C54.98 5.88 54.74 5.17 54.38 4.72L54.38 4.72C54.38 4.72 54.98 4.00 54.98 2.70C54.98 0.90 54.25 0 52.61 0L51.23 0C50.95 0 50.72 0.22 50.72 0.50L50.72 8.93C50.72 9.21 50.95 9.44 51.23 9.44ZM52.61 1.39C53.30 1.39 53.58 1.76 53.58 2.70C53.58 3.64 53.30 4.02 52.61 4.02L52.12 4.02L52.12 1.39ZM52.61 5.40C53.30 5.40 53.58 5.78 53.58 6.73C53.58 7.67 53.30 8.05 52.61 8.05L52.12 8.05L52.12 5.40ZM60.55 6.58C60.55 5.85 60.35 5.28 59.95 4.84C59.99 4.80 60.02 4.77 60.06 4.73C60.49 4.30 60.65 3.60 60.65 2.73C60.65 0.85 60.05-0.01 58.32-0.01L56.56-0.01C56.28-0.01 56.06 0.21 56.06 0.49L56.06 8.92C56.06 9.20 56.28 9.42 56.56 9.42L56.95 9.42C57.22 9.42 57.44 9.20 57.44 8.92L57.44 5.49L58.07 5.49C58.76 5.49 59.15 5.88 59.15 6.58L59.15 8.92C59.15 9.20 59.37 9.42 59.65 9.42L60.05 9.42C60.33 9.42 60.55 9.20 60.55 8.92ZM57.44 1.39L58.32 1.39C59.05 1.39 59.26 1.78 59.26 2.73C59.26 3.68 58.86 4.07 58.07 4.07L57.44 4.07ZM62.78 0.29C62.72 0.15 62.48 0 62.31 0L61.87 0C61.47 0 61.25 0.35 61.40 0.70C62.01 2.10 62.62 3.49 63.22 4.89L63.22 8.93C63.22 9.21 63.45 9.44 63.71 9.44L64.11 9.44C64.39 9.44 64.61 9.21 64.61 8.93L64.61 4.90L66.42 0.70C66.56 0.35 66.33 0 65.95 0L65.49 0C65.34 0 65.10 0.15 65.03 0.29L63.91 2.87Z"></path></g><!----><!----></svg>
|
After Width: | Height: | Size: 4.5 KiB |
|
@ -34,12 +34,13 @@
|
||||||
"web_accessible_resources": [
|
"web_accessible_resources": [
|
||||||
"popup.html",
|
"popup.html",
|
||||||
"tools/YTtoLBRY.html",
|
"tools/YTtoLBRY.html",
|
||||||
"icons/lbry-logo.svg"
|
"icons/lbry/lbry-logo.svg",
|
||||||
|
"icons/lbry/odysee-logo.svg"
|
||||||
],
|
],
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "icons/icon16.png",
|
"16": "icons/wol/icon16.png",
|
||||||
"48": "icons/icon48.png",
|
"48": "icons/wol/icon48.png",
|
||||||
"128": "icons/icon128.png"
|
"128": "icons/wol/icon128.png"
|
||||||
},
|
},
|
||||||
"manifest_version": 2
|
"manifest_version": 2
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { h, render } from 'preact';
|
import { h, JSX, render } from 'preact';
|
||||||
|
|
||||||
import { parseProtocolUrl } from '../common/lbry-url';
|
import { parseProtocolUrl } from '../common/lbry-url';
|
||||||
import { getSettingsAsync, LbrySettings, redirectDomains } from '../common/settings';
|
import { getSettingsAsync, LbrySettings, redirectDomains } from '../common/settings';
|
||||||
|
@ -13,11 +13,27 @@ interface UpdaterOptions {
|
||||||
|
|
||||||
interface UpdateContext {
|
interface UpdateContext {
|
||||||
descriptor: YTDescriptor
|
descriptor: YTDescriptor
|
||||||
|
/** LBRY URL fragment */
|
||||||
url: string
|
url: string
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
redirect: LbrySettings['redirect']
|
redirect: LbrySettings['redirect']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ButtonSettings {
|
||||||
|
text: string
|
||||||
|
icon: string
|
||||||
|
style?: JSX.CSSProperties
|
||||||
|
}
|
||||||
|
|
||||||
|
const buttonSettings: Record<LbrySettings['redirect'], ButtonSettings> = {
|
||||||
|
app: { text: 'Watch on LBRY', icon: chrome.runtime.getURL('icons/lbry/lbry-logo.svg') },
|
||||||
|
'lbry.tv': { text: 'Watch on LBRY', icon: chrome.runtime.getURL('icons/lbry/lbry-logo.svg') },
|
||||||
|
odysee: {
|
||||||
|
text: 'Watch on Odysee', icon: chrome.runtime.getURL('icons/lbry/odysee-logo.svg'),
|
||||||
|
style: { backgroundColor: '#1e013b' },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
function pauseVideo() { document.querySelectorAll<HTMLVideoElement>('video').forEach(v => v.pause()); }
|
function pauseVideo() { document.querySelectorAll<HTMLVideoElement>('video').forEach(v => v.pause()); }
|
||||||
|
|
||||||
function openApp(url: string) {
|
function openApp(url: string) {
|
||||||
|
@ -35,13 +51,12 @@ async function resolveYT(descriptor: YTDescriptor) {
|
||||||
/** Compute the URL and determine whether or not a redirect should be performed. Delegates the redirect to callbacks. */
|
/** Compute the URL and determine whether or not a redirect should be performed. Delegates the redirect to callbacks. */
|
||||||
async function handleURLChange(url: URL | Location, { onRedirect, onURL }: UpdaterOptions): Promise<void> {
|
async function handleURLChange(url: URL | Location, { onRedirect, onURL }: UpdaterOptions): Promise<void> {
|
||||||
const { enabled, redirect } = await getSettingsAsync('enabled', 'redirect');
|
const { enabled, redirect } = await getSettingsAsync('enabled', 'redirect');
|
||||||
const urlPrefix = redirectDomains[redirect].prefix;
|
|
||||||
const descriptor = ytService.getId(url.href);
|
const descriptor = ytService.getId(url.href);
|
||||||
if (!descriptor) return; // couldn't get the ID, so we're done
|
if (!descriptor) return; // couldn't get the ID, so we're done
|
||||||
const res = await resolveYT(descriptor);
|
const res = await resolveYT(descriptor);
|
||||||
if (!res) return; // couldn't find it on lbry, so we're done
|
if (!res) return; // couldn't find it on lbry, so we're done
|
||||||
|
|
||||||
const ctx = { descriptor, url: urlPrefix + res, enabled, redirect };
|
const ctx = { descriptor, url: res, enabled, redirect };
|
||||||
if (onURL) onURL(ctx);
|
if (onURL) onURL(ctx);
|
||||||
if (enabled && onRedirect) onRedirect(ctx);
|
if (enabled && onRedirect) onRedirect(ctx);
|
||||||
}
|
}
|
||||||
|
@ -62,15 +77,17 @@ async function findMountPoint(): Promise<HTMLDivElement | void> {
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|
||||||
function WatchOnLbryButton({ url }: { url?: string }) {
|
function WatchOnLbryButton({ redirect = 'app', url }: { redirect?: LbrySettings['redirect'], url?: string }) {
|
||||||
if (!url) return null;
|
if (!url) return null;
|
||||||
|
const domain = redirectDomains[redirect];
|
||||||
|
const buttonSetting = buttonSettings[redirect];
|
||||||
return <div style={{ display: 'flex', justifyContent: 'center', flexDirection: 'column' }}>
|
return <div style={{ display: 'flex', justifyContent: 'center', flexDirection: 'column' }}>
|
||||||
<a href={url} onClick={pauseVideo} role='button'
|
<a href={domain.prefix + url} onClick={pauseVideo} role='button'
|
||||||
children={<div>
|
children={<div>
|
||||||
<img src={chrome.runtime.getURL('icons/lbry-logo.svg')} height={10} width={14}
|
<img src={buttonSetting.icon} height={10} width={14}
|
||||||
style={{ marginRight: 12, transform: 'scale(1.75)' }} />
|
style={{ marginRight: 12, transform: 'scale(1.75)' }} />
|
||||||
Watch on LBRY
|
{buttonSetting.text}
|
||||||
</div>}
|
</div>}
|
||||||
style={{
|
style={{
|
||||||
borderRadius: '2px',
|
borderRadius: '2px',
|
||||||
backgroundColor: '#075656',
|
backgroundColor: '#075656',
|
||||||
|
@ -80,18 +97,19 @@ function WatchOnLbryButton({ url }: { url?: string }) {
|
||||||
marginRight: '5px',
|
marginRight: '5px',
|
||||||
fontSize: '14px',
|
fontSize: '14px',
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
|
...buttonSetting.style,
|
||||||
}} />
|
}} />
|
||||||
</div>
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const mountPointPromise = findMountPoint();
|
const mountPointPromise = findMountPoint();
|
||||||
|
|
||||||
const handle = (url: URL | Location) => handleURLChange(url, {
|
const handle = (url: URL | Location) => handleURLChange(url, {
|
||||||
async onURL({ descriptor: { type }, url }) {
|
async onURL({ descriptor: { type }, url, redirect }) {
|
||||||
const mountPoint = await mountPointPromise;
|
const mountPoint = await mountPointPromise;
|
||||||
if (type !== 'video' || !mountPoint) return;
|
if (type !== 'video' || !mountPoint) return;
|
||||||
render(<WatchOnLbryButton url={url} />, mountPoint)
|
render(<WatchOnLbryButton url={url} redirect={redirect} />, mountPoint);
|
||||||
},
|
},
|
||||||
onRedirect({ redirect, url }) {
|
onRedirect({ redirect, url }) {
|
||||||
if (redirect === 'app') return openApp(url);
|
if (redirect === 'app') return openApp(url);
|
||||||
|
@ -114,5 +132,5 @@ chrome.runtime.onMessage.addListener(async (req: { url: string }) => {
|
||||||
|
|
||||||
chrome.storage.onChanged.addListener((changes, areaName) => {
|
chrome.storage.onChanged.addListener((changes, areaName) => {
|
||||||
if (areaName !== 'local' || !changes.redirect) return;
|
if (areaName !== 'local' || !changes.redirect) return;
|
||||||
handle(new URL(location.href))
|
handle(new URL(location.href));
|
||||||
});
|
});
|
||||||
|
|