diff options
Diffstat (limited to 'recipes/instagram-direct-messages')
-rw-r--r-- | recipes/instagram-direct-messages/icon.svg | 51 | ||||
-rw-r--r-- | recipes/instagram-direct-messages/index.js | 7 | ||||
-rw-r--r-- | recipes/instagram-direct-messages/package.json | 10 | ||||
-rw-r--r-- | recipes/instagram-direct-messages/service.css | 13 | ||||
-rw-r--r-- | recipes/instagram-direct-messages/webview.js | 28 |
5 files changed, 109 insertions, 0 deletions
diff --git a/recipes/instagram-direct-messages/icon.svg b/recipes/instagram-direct-messages/icon.svg new file mode 100644 index 0000000..fa2ba39 --- /dev/null +++ b/recipes/instagram-direct-messages/icon.svg | |||
@@ -0,0 +1,51 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Generator: Adobe Illustrator 27.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> | ||
3 | <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" | ||
4 | viewBox="0 0 132 132" style="enable-background:new 0 0 132 132;" xml:space="preserve"> | ||
5 | <style type="text/css"> | ||
6 | .st0{fill:url(#SVGID_1_);} | ||
7 | .st1{fill:url(#SVGID_00000121994455931706847470000007918034486910933644_);} | ||
8 | .st2{fill:#FFFFFF;} | ||
9 | </style> | ||
10 | <radialGradient id="SVGID_1_" cx="-251.6848" cy="-216.476" r="65" gradientTransform="matrix(0 -1.982 -1.8439 0 -363.6215 -357.8334)" gradientUnits="userSpaceOnUse"> | ||
11 | <stop offset="0" style="stop-color:#FFDD55"/> | ||
12 | <stop offset="0.1" style="stop-color:#FFDD55"/> | ||
13 | <stop offset="0.5" style="stop-color:#FF543E"/> | ||
14 | <stop offset="1" style="stop-color:#C837AB"/> | ||
15 | </radialGradient> | ||
16 | <path class="st0" d="M66,1C38.9,1,31,1,29.4,1.2c-5.6,0.5-9,1.3-12.8,3.2c-2.9,1.4-5.2,3.1-7.5,5.5C5,14.1,2.5,19.4,1.6,25.7 | ||
17 | C1.2,28.7,1,29.3,1,44.8C1,50,1,56.8,1,66c0,27.1,0,35,0.2,36.6c0.5,5.4,1.3,8.8,3.1,12.6c3.4,7.1,10,12.5,17.8,14.5 | ||
18 | c2.7,0.7,5.6,1.1,9.4,1.2c1.6,0.1,18,0.1,34.4,0.1s32.8,0,34.4-0.1c4.4-0.2,7-0.6,9.8-1.3c7.8-2,14.2-7.3,17.8-14.5 | ||
19 | c1.8-3.6,2.7-7.2,3.1-12.3c0.1-1.1,0.1-19,0.1-36.8c0-17.8,0-35.7-0.1-36.8c-0.4-5.2-1.3-8.7-3.1-12.4c-1.5-3-3.2-5.3-5.6-7.6 | ||
20 | c-4.3-4.1-9.6-6.6-15.8-7.5c-3-0.4-3.6-0.6-19.2-0.6H66z"/> | ||
21 | <radialGradient id="SVGID_00000117678177208529337080000018111114087349278086_" cx="360.7799" cy="56.3619" r="65" gradientTransform="matrix(0.1739 0.8687 3.5818 -0.7172 -285.4104 -262.6309)" gradientUnits="userSpaceOnUse"> | ||
22 | <stop offset="0" style="stop-color:#3771C8"/> | ||
23 | <stop offset="0.128" style="stop-color:#3771C8"/> | ||
24 | <stop offset="1" style="stop-color:#6600FF;stop-opacity:0"/> | ||
25 | </radialGradient> | ||
26 | <path style="fill:url(#SVGID_00000117678177208529337080000018111114087349278086_);" d="M66,1C38.9,1,31,1,29.4,1.2 | ||
27 | c-5.6,0.5-9,1.3-12.8,3.2c-2.9,1.4-5.2,3.1-7.5,5.5C5,14.1,2.5,19.4,1.6,25.7C1.2,28.7,1,29.3,1,44.8C1,50,1,56.8,1,66 | ||
28 | c0,27.1,0,35,0.2,36.6c0.5,5.4,1.3,8.8,3.1,12.6c3.4,7.1,10,12.5,17.8,14.5c2.7,0.7,5.6,1.1,9.4,1.2c1.6,0.1,18,0.1,34.4,0.1 | ||
29 | s32.8,0,34.4-0.1c4.4-0.2,7-0.6,9.8-1.3c7.8-2,14.2-7.3,17.8-14.5c1.8-3.6,2.7-7.2,3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-5.5,3.6c-1.7,0.7-4.2,1.4-8.9,1.7c-5.1,0.2-6.6,0.3-19.4,0.3c-12.8,0-14.3-0.1-19.4-0.3 | ||
40 | c-4.7-0.2-7.2-1-8.9-1.7c-2.2-0.9-3.8-1.9-5.5-3.6c-1.7-1.7-2.7-3.3-3.6-5.5c-0.7-1.7-1.4-4.2-1.7-8.9c-0.2-5.1-0.3-6.6-0.3-19.4 | ||
41 | s0-14.3,0.3-19.4c0.2-4.7,1-7.2,1.7-8.9c0.9-2.2,1.9-3.8,3.6-5.5c1.7-1.7,3.3-2.7,5.5-3.6c1.7-0.7,4.2-1.4,8.9-1.7 | ||
42 | C51,26.7,52.8,26.6,61.7,26.6L61.7,26.6z"/> | ||
43 | <g> | ||
44 | <path class="st2" d="M91.7,49.5c-3.2,5.3-6.3,10.6-9.5,16c-4.6,7.9-9.2,15.7-13.8,23.6c-0.7,1.1-1.3,2.2-3,2 | ||
45 | c-1.5-0.2-1.8-1.5-2.1-2.7c-1.7-6.7-3.3-13.5-5.1-20.2c-0.3-1.2-1-2.4-1.9-3.2c-4.7-4.8-9.5-9.5-14.3-14.2 | ||
46 | c-0.6-0.6-1.2-1.3-1.7-1.9c0-0.5,0-0.9,0-1.4c0.8-1.3,2-1.5,3.4-1.5c14.9,0.2,29.8,0.4,44.7,0.6c1.4,0,2.5,0.4,3.2,1.6 | ||
47 | C91.7,48.6,91.7,49,91.7,49.5z M82.8,55.5c-0.1-0.1-0.2-0.2-0.2-0.3c-6.7,3.7-13.3,7.4-20.1,11.1c1.4,5.5,2.7,10.8,4.2,16.6 | ||
48 | C72.2,73.5,77.5,64.5,82.8,55.5z M80.1,51.3c-0.1-0.2-0.1-0.4-0.2-0.6c-10.4,0-20.7,0-30.6,0c3.5,3.7,7.2,7.6,11,11.6 | ||
49 | C67,58.6,73.5,55,80.1,51.3z"/> | ||
50 | </g> | ||
51 | </svg> | ||
diff --git a/recipes/instagram-direct-messages/index.js b/recipes/instagram-direct-messages/index.js new file mode 100644 index 0000000..bfa1949 --- /dev/null +++ b/recipes/instagram-direct-messages/index.js | |||
@@ -0,0 +1,7 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | module.exports = Ferdium => class Messenger extends Ferdium { | ||
4 | overrideUserAgent() { | ||
5 | return window.navigator.userAgent.replace(/(Ferdium|Electron)(\S+\s)/g, ''); | ||
6 | } | ||
7 | }; | ||
diff --git a/recipes/instagram-direct-messages/package.json b/recipes/instagram-direct-messages/package.json new file mode 100644 index 0000000..674f8b3 --- /dev/null +++ b/recipes/instagram-direct-messages/package.json | |||
@@ -0,0 +1,10 @@ | |||
1 | { | ||
2 | "id": "instagram-direct-messages", | ||
3 | "name": "Instagram Direct Messages", | ||
4 | "version": "1.0.0", | ||
5 | "license": "MIT", | ||
6 | "config": { | ||
7 | "serviceURL": "https://www.instagram.com/direct/inbox/", | ||
8 | "hasNotificationSound": true | ||
9 | } | ||
10 | } | ||
diff --git a/recipes/instagram-direct-messages/service.css b/recipes/instagram-direct-messages/service.css new file mode 100644 index 0000000..b31cbc8 --- /dev/null +++ b/recipes/instagram-direct-messages/service.css | |||
@@ -0,0 +1,13 @@ | |||
1 | #react-root>section>.t30g8.L1C6I, | ||
2 | #react-root>section>div:first-child { | ||
3 | padding-top: 0; | ||
4 | } | ||
5 | |||
6 | #react-root>section .Hz2_lz6s.Hz2lFlF, | ||
7 | #react-root>section>div:first-child>div:first-child { | ||
8 | display: none; | ||
9 | } | ||
10 | |||
11 | #react-root>section .i0EQd { | ||
12 | max-width: unset !important; | ||
13 | } | ||
diff --git a/recipes/instagram-direct-messages/webview.js b/recipes/instagram-direct-messages/webview.js new file mode 100644 index 0000000..b59b9f2 --- /dev/null +++ b/recipes/instagram-direct-messages/webview.js | |||
@@ -0,0 +1,28 @@ | |||
1 | "use strict"; | ||
2 | |||
3 | const _path = _interopRequireDefault(require('path')); | ||
4 | |||
5 | function _interopRequireDefault(obj) { | ||
6 | return obj && obj.__esModule ? obj : { default: obj }; | ||
7 | } | ||
8 | |||
9 | setInterval(() => { | ||
10 | document.querySelector("._lz6s.Hz2lF").style.display = "none"; | ||
11 | document.querySelector(".t30g8.L1C6I").style.paddingTop = 0; | ||
12 | document.querySelector(".i0EQd").style.maxWidth = 'unset !important'; | ||
13 | }, 3000); | ||
14 | |||
15 | module.exports = (Ferdium) => { | ||
16 | const getMessages = () => { | ||
17 | let count = 0; | ||
18 | const elements = document.querySelectorAll('.rBNOH.soMvl'); | ||
19 | if (elements.length > 0) { | ||
20 | count += 1; | ||
21 | } | ||
22 | Ferdium.setBadge(count); | ||
23 | }; | ||
24 | |||
25 | Ferdium.loop(getMessages); | ||
26 | |||
27 | Ferdium.injectCSS(_path.default.join(__dirname, 'service.css')); | ||
28 | }; | ||