From da88659dd55a9f9a6927b9051c8b27d531f5e108 Mon Sep 17 00:00:00 2001 From: theo1 Date: Tue, 29 Sep 2020 16:22:09 +0200 Subject: [PATCH] adding Firefox extension containing browser action to toot stuff --- deezer-tooter/browserAction/index.html | 14 ++++++++++++ deezer-tooter/browserAction/script.js | 20 +++++++++++++++++ deezer-tooter/browserAction/style.css | 0 deezer-tooter/content_script.js | 0 deezer-tooter/icons/icon.png | Bin 0 -> 3066 bytes deezer-tooter/manifest.json | 29 +++++++++++++++++++++++++ deezer-tooter/options/index.html | 11 ++++++++++ deezer-tooter/options/script.js | 1 + deezer-tooter/options/style.css | 3 +++ 9 files changed, 78 insertions(+) create mode 100644 deezer-tooter/browserAction/index.html create mode 100644 deezer-tooter/browserAction/script.js create mode 100644 deezer-tooter/browserAction/style.css create mode 100644 deezer-tooter/content_script.js create mode 100644 deezer-tooter/icons/icon.png create mode 100644 deezer-tooter/manifest.json create mode 100644 deezer-tooter/options/index.html create mode 100644 deezer-tooter/options/script.js create mode 100644 deezer-tooter/options/style.css diff --git a/deezer-tooter/browserAction/index.html b/deezer-tooter/browserAction/index.html new file mode 100644 index 0000000..125d948 --- /dev/null +++ b/deezer-tooter/browserAction/index.html @@ -0,0 +1,14 @@ + + + + + + + + +
+
+ Gemini + + + diff --git a/deezer-tooter/browserAction/script.js b/deezer-tooter/browserAction/script.js new file mode 100644 index 0000000..770fa5b --- /dev/null +++ b/deezer-tooter/browserAction/script.js @@ -0,0 +1,20 @@ + +function tootButtonHandler() { + // TODO : add content script to get the pages' HTML elements + tootContent = "Now playing awesome stuff !" + url = "http://localhost:5000/toot?content=" + console.log(tootContent) + fetch(url) + .then(function (response) { + return response; + }) + .then(function (response) { + console.log("Got response : " + response); + }) + .catch(function (error) { + console.log("Error while tooting: " + error); + }) +} + +button = document.getElementById('toot-button') +button.onclick = tootButtonHandler \ No newline at end of file diff --git a/deezer-tooter/browserAction/style.css b/deezer-tooter/browserAction/style.css new file mode 100644 index 0000000..e69de29 diff --git a/deezer-tooter/content_script.js b/deezer-tooter/content_script.js new file mode 100644 index 0000000..e69de29 diff --git a/deezer-tooter/icons/icon.png b/deezer-tooter/icons/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..063cfa8f40d2773ce841dea48d343e3940b2b7ee GIT binary patch literal 3066 zcmV z|GfVHoCCu|`E-W4U&-k7gg@K%j4ZO_WYO^}A8#LaeqNUZU1IKM8rhdOo%w+;JEglK zv7;4<8}H{GBk}L!vy$47miuA`Lglk_Z0(dxTW?ixWNH%o7ggdkRdN<-5_d-7*|ish zl)i@tGY?uN3ma!9wrhQMwyh(aT#(MRWXzDf?E@EZQUu33;(1Q-I*V1wC94v9z(*RO z1)A!0L_zvbTB<_wAVp-~Q@u`E^SW+m^WA#2LO)X^=PAWw|2am96~gB-yC%!LL!zGA zP9(P}f}L0R;+bg%(2-X@kaEfmA8Jts>f|P;VcjMpvj*)&PqrikJKP z+&o8rvxF~rIwz_kw?&)px>SXwdR>?BGyKl9Gl>JZ)Wy}%LYklr8c%0Aeq0UY6*MhAMcr7Z5;)X1 zTB{dh3j2Z{Hq}@YWWhc_6}ZjjK*A0npwoUng^fwP#2uRm;x9rlJih;M!VKg7pOGm0b^?t*<70E*J8y+U9>@4U_`?| zL$=8QhXQ6s?*FG;NERHu7y|gxY-0mpzWX{YK8xxSuL!o@H0*bq5ntU2+-_jhYkf5YmmcggYN8n5AuzDx;Z<-*#F%X&`P2AeBbz_Md?D&b9?YVkqpZ<7fVhEUgB&@*qqGHiXatlu-Vs3DMAp+Fz3-cw)Ls?Y zt#>oPX@Dtkoff&R;CffZ<6u!09n)!%k(Q;ZJ5837$>fEH8YCCa!| z$?-0MR5XL|w*p$ESdZ}K%!D6NFtLn=(D%(H2Y?o6g0^}tM!G((3G716>%7>kk|HAs zB2A^~{C zpdq4~Ax%KnDBId8OSXZUqSH2NFc{;ruQ#j;A6YKQU%8# z%E$jhdva_;HN1aUpbgr_bnQl5z$xZSot$oPz>$*@*NX8W&d+gY1m5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EBsH;faGPG?L=`ao{REb-CUT}UhAvIBt@6@qINuV<0*(7oh_YLZz zO|v=^$jfRUcOuiiZcP7#?>a?s!03Jn-~BhkzAn$|8D3-m0#b)|yCXX#fBK literal 0 HcmV?d00001 diff --git a/deezer-tooter/manifest.json b/deezer-tooter/manifest.json new file mode 100644 index 0000000..8733124 --- /dev/null +++ b/deezer-tooter/manifest.json @@ -0,0 +1,29 @@ +{ + "manifest_version": 2, + "name": "Deezer Tooter", + "description": "Toots currently playing track from Deezer", + "version": "0.1", + "icons": { + "64": "icons/icon.png" + }, + "content_scripts": [ + { + "matches": [ + "*://*.mozilla.org/*" + ], + "js": [ + "content_script.js" + ] + } + ], + "browser_action": { + "default_icon": { + "64": "icons/icon.png" + }, + "default_popup": "browserAction/index.html", + "default_title": "Deezer Tooter" + }, + "options_ui": { + "page": "options/index.html" + } +} \ No newline at end of file diff --git a/deezer-tooter/options/index.html b/deezer-tooter/options/index.html new file mode 100644 index 0000000..9cd1953 --- /dev/null +++ b/deezer-tooter/options/index.html @@ -0,0 +1,11 @@ + + + + + + + +

My content

+ + + diff --git a/deezer-tooter/options/script.js b/deezer-tooter/options/script.js new file mode 100644 index 0000000..58ffbf9 --- /dev/null +++ b/deezer-tooter/options/script.js @@ -0,0 +1 @@ +document.getElementById('myHeading').style.color = 'red' diff --git a/deezer-tooter/options/style.css b/deezer-tooter/options/style.css new file mode 100644 index 0000000..001d5c5 --- /dev/null +++ b/deezer-tooter/options/style.css @@ -0,0 +1,3 @@ +h1 { + font-style: italic; +}