29 Commits
v1.3 ... v1.5.0

Author SHA1 Message Date
91f1833534 Migrate to manifest v3 2023-12-10 11:15:53 +03:00
Anatoly Kopyl
4089f640ea Merge pull request #25 from anatolykopyl/dependabot/npm_and_yarn/postcss-8.4.31
Bump postcss from 8.4.20 to 8.4.31
2023-12-09 13:15:20 +03:00
Anatoly Kopyl
85596a95a6 Merge pull request #26 from anatolykopyl/dependabot/npm_and_yarn/babel/traverse-7.23.2
Bump @babel/traverse from 7.9.5 to 7.23.2
2023-10-28 11:53:03 +03:00
dependabot[bot]
4cebd66a85 Bump @babel/traverse from 7.9.5 to 7.23.2
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.9.5 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-20 00:45:14 +00:00
dependabot[bot]
bc49282b62 Bump postcss from 8.4.20 to 8.4.31
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.20 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.20...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-07 10:53:05 +00:00
Anatoly Kopyl
78c6b02214 Merge pull request #24 from anatolykopyl/dependabot/npm_and_yarn/webpack-5.76.0
Bump webpack from 5.75.0 to 5.76.0
2023-03-17 11:41:04 +03:00
dependabot[bot]
97a8920057 Bump webpack from 5.75.0 to 5.76.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-15 09:35:17 +00:00
Anatoly Kopyl
a22c3485fa Merge pull request #23 from anatolykopyl/dependabot/npm_and_yarn/json5-and-babel-loader-and-css-loader-and-html-webpack-plugin-and-webpack-2.2.3
Bump json5, babel-loader, css-loader, html-webpack-plugin and webpack
2023-01-01 22:38:20 +03:00
dependabot[bot]
fd8c01e41b Bump json5, babel-loader, css-loader, html-webpack-plugin and webpack
Bumps [json5](https://github.com/json5/json5) to 2.2.3 and updates ancestor dependencies [json5](https://github.com/json5/json5), [babel-loader](https://github.com/babel/babel-loader), [css-loader](https://github.com/webpack-contrib/css-loader), [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) and [webpack](https://github.com/webpack/webpack). These dependencies need to be updated together.


Updates `json5` from 2.1.3 to 2.2.3
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.1.3...v2.2.3)

Updates `babel-loader` from 8.1.0 to 8.3.0
- [Release notes](https://github.com/babel/babel-loader/releases)
- [Changelog](https://github.com/babel/babel-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel-loader/compare/v8.1.0...v8.3.0)

Updates `css-loader` from 3.5.2 to 6.7.3
- [Release notes](https://github.com/webpack-contrib/css-loader/releases)
- [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/css-loader/compare/v3.5.2...v6.7.3)

Updates `html-webpack-plugin` from 4.2.0 to 5.5.0
- [Release notes](https://github.com/jantimon/html-webpack-plugin/releases)
- [Changelog](https://github.com/jantimon/html-webpack-plugin/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jantimon/html-webpack-plugin/compare/v4.2.0...v5.5.0)

Updates `webpack` from 4.42.1 to 5.75.0
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.42.1...v5.75.0)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
- dependency-name: babel-loader
  dependency-type: direct:development
- dependency-name: css-loader
  dependency-type: direct:development
- dependency-name: html-webpack-plugin
  dependency-type: direct:development
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-01 19:37:39 +00:00
Anatoly Kopyl
aad1365953 Merge pull request #21 from anatolykopyl/dependabot/npm_and_yarn/loader-utils-1.4.2
Bump loader-utils from 1.4.1 to 1.4.2
2022-11-25 02:40:15 +03:00
dependabot[bot]
de578fd210 Bump loader-utils from 1.4.1 to 1.4.2
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-18 00:39:12 +00:00
Anatoly Kopyl
59ca6bb360 Merge pull request #20 from anatolykopyl/dependabot/npm_and_yarn/minimatch-3.1.2
Bump minimatch from 3.0.4 to 3.1.2
2022-11-10 23:21:20 +03:00
dependabot[bot]
f7474d863b Bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 20:20:24 +00:00
Anatoly Kopyl
9a2381690e Merge pull request #19 from anatolykopyl/dependabot/npm_and_yarn/loader-utils-1.4.1
Bump loader-utils from 1.4.0 to 1.4.1
2022-11-10 23:14:05 +03:00
dependabot[bot]
ecc265430b Bump loader-utils from 1.4.0 to 1.4.1
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 09:50:42 +00:00
Anatoly Kopyl
a8290e41f3 Merge pull request #18 from anatolykopyl/dependabot/npm_and_yarn/glob-parent-5.1.2
Bump glob-parent from 3.1.0 to 5.1.2
2022-10-09 13:13:10 +03:00
dependabot[bot]
343ebe14ea Bump glob-parent from 3.1.0 to 5.1.2
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 3.1.0 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-09 10:12:57 +00:00
Anatoly Kopyl
31dcbae1da Merge pull request #17 from anatolykopyl/dependabot/npm_and_yarn/terser-4.8.1
Bump terser from 4.6.11 to 4.8.1
2022-08-14 04:11:42 +03:00
dependabot[bot]
2330704243 Bump terser from 4.6.11 to 4.8.1
Bumps [terser](https://github.com/terser/terser) from 4.6.11 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/commits)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 01:38:14 +00:00
Anatoly
56bf77001c Merge pull request #16 from anatolykopyl/dependabot/npm_and_yarn/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6
2022-04-03 13:12:23 +03:00
dependabot[bot]
d8f653382b Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-26 16:24:48 +00:00
afa274b651 Bump manifest version 2022-02-20 02:45:07 +03:00
9a201e7412 Обновил иконку 2022-02-20 02:35:06 +03:00
Anatoly
fee04826c9 Merge pull request #15 from anatolykopyl/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2022-02-13 13:43:12 +03:00
Anatoly
ae88addcfd Merge pull request #14 from anatolykopyl/dependabot/npm_and_yarn/nth-check-2.0.1
Bump nth-check from 2.0.0 to 2.0.1
2022-02-13 13:42:57 +03:00
dependabot[bot]
119d598c24 Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 10:42:00 +00:00
dependabot[bot]
c227c69aaf Bump nth-check from 2.0.0 to 2.0.1
Bumps [nth-check](https://github.com/fb55/nth-check) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/fb55/nth-check/releases)
- [Commits](https://github.com/fb55/nth-check/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: nth-check
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 10:42:00 +00:00
Anatoly
874c0694ba Merge pull request #13 from anatolykopyl/dependabot/npm_and_yarn/ajv-6.12.6
Bump ajv from 6.12.0 to 6.12.6
2022-02-13 13:41:30 +03:00
dependabot[bot]
671ab3c037 Bump ajv from 6.12.0 to 6.12.6
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.0 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.0...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 10:39:45 +00:00
22 changed files with 2626 additions and 8188 deletions

View File

@@ -1,3 +1,3 @@
{ {
"presets": ["@babel/preset-env"] "presets": ["@babel/preset-env"]
} }

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
/node_modules /node_modules
.DS_Store
/.cache /.cache
/.idea /.idea
/assets /assets

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because one or more lines are too long

1224
extension/dist/dom.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -2,12 +2,11 @@
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
</head> <script defer src="popup.js"></script></head>
<body> <body>
<div class="header"> <div class="header">
<h3 align="center">VK Mute</h3> <h3 align="center">VK Mute</h3>
</div> </div>
<!--<button id="disableButton">Toggle</button>-->
<div style="text-align: center;"> <div style="text-align: center;">
<label class="switch"> <label class="switch">
<input type="checkbox" id="disableCheckbox"> <input type="checkbox" id="disableCheckbox">
@@ -19,5 +18,5 @@
<div class="donation_btn"> <div class="donation_btn">
<a href="./donate.html" title="Пожертвовать" target="_blank">💸</a> <a href="./donate.html" title="Пожертвовать" target="_blank">💸</a>
</div> </div>
<script src="popup.js"></script></body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@@ -6,20 +6,21 @@
"128": "assets/icons/icon128.png", "128": "assets/icons/icon128.png",
"48": "assets/icons/icon48.png" "48": "assets/icons/icon48.png"
}, },
"version": "1.3", "version": "1.5.0",
"description": "Позволяет заглушить нежелаемых собеседников", "description": "Позволяет заглушить нежелаемых собеседников",
"permissions": [ "permissions": [
"declarativeContent",
"storage" "storage"
], ],
"background": { "action": {
"scripts": ["dist/background.js"], "default_icon": {
"persistent": false "140": "assets/icons/icon140.png",
}, "128": "assets/icons/icon128.png",
"page_action": { "48": "assets/icons/icon48.png"
},
"default_title": "VK Mute",
"default_popup": "dist/popup.html" "default_popup": "dist/popup.html"
}, },
"manifest_version": 2, "manifest_version": 3,
"content_scripts": [ "content_scripts": [
{ {
"matches": ["https://*.vk.com/*"], "matches": ["https://*.vk.com/*"],
@@ -27,6 +28,9 @@
} }
], ],
"web_accessible_resources": [ "web_accessible_resources": [
"assets/mute.png" {
"resources": ["assets/mute.png"],
"matches": ["https://*.vk.com/*"]
}
] ]
} }

8860
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "vk-mute", "name": "vk-mute",
"version": "1.0.0", "version": "1.5.0",
"description": "Заглушить собеседника в беседе в ВК. 🔇", "description": "Заглушить собеседника в беседе в ВК. 🔇",
"main": "src/dom/main.js", "main": "src/dom/main.js",
"scripts": { "scripts": {
@@ -11,8 +11,8 @@
"type": "git", "type": "git",
"url": "git+https://github.com/anatolykopyl/vk-mute.git" "url": "git+https://github.com/anatolykopyl/vk-mute.git"
}, },
"author": "", "author": "Anatoly Kopyl <hi@kopyl.dev>",
"license": "ISC", "license": "GPL-3.0",
"bugs": { "bugs": {
"url": "https://github.com/anatolykopyl/vk-mute/issues" "url": "https://github.com/anatolykopyl/vk-mute/issues"
}, },
@@ -20,11 +20,12 @@
"devDependencies": { "devDependencies": {
"@babel/core": "^7.9.0", "@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5", "@babel/preset-env": "^7.9.5",
"babel-loader": "^8.1.0", "babel-loader": "^8.3.0",
"css-loader": "^3.5.2", "css-loader": "^6.7.3",
"html-webpack-plugin": "^4.2.0", "html-webpack-plugin": "^5.5.0",
"raw-loader": "^4.0.2",
"style-loader": "^1.1.4", "style-loader": "^1.1.4",
"webpack": "^4.42.1", "webpack": "^5.76.0",
"webpack-cli": "^4.7.2" "webpack-cli": "^4.7.2"
} }
} }

View File

@@ -1,14 +0,0 @@
chrome.runtime.onInstalled.addListener(function () {
chrome.storage.sync.set({ isExtensionOn: true }, function () {
console.log('isExtensionOn: ' + true);
});
chrome.declarativeContent.onPageChanged.removeRules(undefined, function () {
chrome.declarativeContent.onPageChanged.addRules([{
conditions: [new chrome.declarativeContent.PageStateMatcher({
pageUrl: { hostEquals: 'vk.com' },
})],
actions: [new chrome.declarativeContent.ShowPageAction()]
}]);
});
});

66
src/dom/controls.js vendored
View File

@@ -1,20 +1,24 @@
import {getChatBody} from "../utils/getChatBody";
import muteSvg from "./mute.svg";
/** /**
* *
* @param id {String} * @param id {String}
* @return {HTMLSpanElement} * @return {HTMLSpanElement}
*/ */
import {getChatBody} from "../utils/getChatBody";
function muteBtnHTML(id) { function muteBtnHTML(id) {
const element = document.createElement('span'); const element = document.createElement('span');
element.setAttribute('class', 'mute_message'); element.setAttribute('class', 'im-mess--mute');
element.setAttribute('id', `mute${id}`); element.setAttribute('id', `mute${id}`);
element.setAttribute('label', 'Заглушить'); element.setAttribute('label', 'Заглушить');
element.style.background = `url(${chrome.runtime.getURL("assets/mute.png")}) center no-repeat`; element.innerHTML = muteSvg + '<div class="mute_tooltip tt_w tt_black tt_down"><div class="tt_text">Заглушить</div></div>';
element.innerHTML = '<div class="mute_tooltip tt_w tt_black tt_down"><div class="tt_text">Заглушить</div></div>';
return element; return element;
} }
/**
*
* @param target {HTMLElenemt}
*/
export function tryToAddControls(target) { export function tryToAddControls(target) {
if (target.className === 'im-mess--check fl_l') { if (target.className === 'im-mess--check fl_l') {
const message = target.parentElement; const message = target.parentElement;
@@ -31,7 +35,7 @@ export function tryToAddControls(target) {
function addMuteButton(actionArea, senderId) { function addMuteButton(actionArea, senderId) {
const muteButton = muteBtnHTML(senderId); const muteButton = muteBtnHTML(senderId);
actionArea.appendChild(muteButton); actionArea.appendChild(muteButton);
muteButton.style.display = "none"; muteButton.style.visibility = "hidden";
return muteButton; return muteButton;
} }
@@ -41,41 +45,39 @@ function addMuteButton(actionArea, senderId) {
*/ */
function addActionAreaEvents(actionsArea) { function addActionAreaEvents(actionsArea) {
actionsArea.parentElement.addEventListener("mouseenter", function (event) { actionsArea.parentElement.addEventListener("mouseenter", function (event) {
event.target.getElementsByClassName("mute_message")[0].style.display = "inline-block"; event.target.getElementsByClassName("im-mess--mute")[0].style.visibility = "visible";
}); });
actionsArea.parentElement.addEventListener("mouseleave", function (event) { actionsArea.parentElement.addEventListener("mouseleave", function (event) {
event.target.getElementsByClassName("mute_message")[0].style.display = "none"; event.target.getElementsByClassName("im-mess--mute")[0].style.visibility = "hidden";
}); });
} }
/** /**
* *
* @return {function(...[]=)} * @this {HTMLElement}
*/ */
function setIdToHideHandle() { function setIdToHideHandle() {
return function (event) { const clickedId = this.id.substring(4);
const clickedId = event.target.id.substr(4); // get id of sender from element id let clickedName = this.parentElement.parentElement.parentElement.parentElement;
let clickedName = event.target.parentElement.parentElement.parentElement.parentElement; clickedName = clickedName.children[0].children[0].children[0].innerText;
clickedName = clickedName.children[0].children[0].children[0].innerText;
chrome.storage.sync.get('idsToHide', function(data) { chrome.storage.sync.get('idsToHide', function(data) {
let idsToHide = data.idsToHide || []; let idsToHide = data.idsToHide || [];
if (idsToHide.filter(user => user.id == clickedId).length === 0) { if (idsToHide.filter(user => user.id == clickedId).length === 0) {
idsToHide.push({ idsToHide.push({
id: clickedId, id: clickedId,
name: clickedName name: clickedName
});
chrome.storage.sync.set({idsToHide: idsToHide}, function () {
chrome.storage.sync.get('isExtensionOn', function(data) {
if (data.isExtensionOn) {
hideExistingMessages();
}
}); });
chrome.storage.sync.set({idsToHide: idsToHide}, function () { });
chrome.storage.sync.get('isExtensionOn', function(data) { }
if (data.isExtensionOn) { });
hideExistingMessages();
}
});
});
}
});
}
} }
export function hideExistingMessages() { export function hideExistingMessages() {
@@ -107,11 +109,11 @@ function addControlButton(message) {
// Check if message is not an outgoing one // Check if message is not an outgoing one
if (!message.classList.contains('im-mess_out')) { if (!message.classList.contains('im-mess_out')) {
const actionsArea = message.getElementsByClassName("im-mess--actions")[0]; const actionsArea = message.getElementsByClassName("im-mess--actions")[0];
if (actionsArea && actionsArea.lastChild.className !== "mute_message") { if (actionsArea && actionsArea.lastChild.className !== "im-mess--mute") {
const senderId = message.parentElement.parentElement.parentElement["dataset"].peer; const senderId = message.parentElement.parentElement.parentElement["dataset"].peer;
const muteBtn = addMuteButton(actionsArea, senderId); const muteBtn = addMuteButton(actionsArea, senderId);
addActionAreaEvents(actionsArea); addActionAreaEvents(actionsArea);
muteBtn.addEventListener("click", setIdToHideHandle()); muteBtn.addEventListener("click", setIdToHideHandle);
return true; return true;
} else { } else {
return false; return false;
@@ -132,4 +134,4 @@ export function tryToInitControls() {
} }
} }
return status; return status;
} }

View File

@@ -10,19 +10,24 @@
} }
/* Show the tooltip text when you mouse over the tooltip container */ /* Show the tooltip text when you mouse over the tooltip container */
.mute_message:hover .mute_tooltip { .im-mess--mute:hover .mute_tooltip {
display: block !important; display: block !important;
opacity: 1; opacity: 1;
} }
.mute_message { .im-mess--mute {
position: relative; position: relative;
display: inline-block; display: inline-flex;
vertical-align: top; align-items: center;
padding-top: 2px; justify-content: center;
width: 24px; width: 24px;
height: 24px; height: 24px;
background-size: 11px !important; opacity: .5;
color: var(--vkui--color_icon_secondary);
}
.im-mess--mute:hover {
opacity: 1;
} }
.im-mess--actions { .im-mess--actions {

9
src/dom/mute.svg Normal file
View File

@@ -0,0 +1,9 @@
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
viewBox="2 1 13 13"
>
<path d="M4.69 5.5 11 11.8v1.7c0 .3-.23.47-.49.5l-3.63-3.5H4a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h.69Zm.77-2.85 2.2 2.19L10.5 2.5c.27.02.49.2.49.48v5.2l2.6 2.6a.75.75 0 0 1-1.06 1.06L4.4 3.71a.75.75 0 0 1 1.06-1.06Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 348 B

View File

@@ -7,7 +7,6 @@
<div class="header"> <div class="header">
<h3 align="center">VK Mute</h3> <h3 align="center">VK Mute</h3>
</div> </div>
<!--<button id="disableButton">Toggle</button>-->
<div style="text-align: center;"> <div style="text-align: center;">
<label class="switch"> <label class="switch">
<input type="checkbox" id="disableCheckbox"> <input type="checkbox" id="disableCheckbox">

View File

@@ -1,9 +1,9 @@
import './popup.css' import './popup.css'
//let disableButton = document.getElementById('disableButton'); //let disableButton = document.getElementById('disableButton');
let disableCheckbox = document.getElementById('disableCheckbox'); const disableCheckbox = document.getElementById('disableCheckbox');
let idsToHideElements = document.getElementsByClassName('idToHide'); const idsToHideElements = document.getElementsByClassName('idToHide');
let idList = document.getElementById("id_list"); const idList = document.getElementById("id_list");
let isExtensionOn; let isExtensionOn;
let idsToHide = []; let idsToHide = [];
@@ -51,4 +51,4 @@ disableCheckbox.addEventListener('change', (event) => {
chrome.storage.sync.set({isExtensionOn}, function() { chrome.storage.sync.set({isExtensionOn}, function() {
console.log('isExtensionOn: '+isExtensionOn); console.log('isExtensionOn: '+isExtensionOn);
}); });
}); });

View File

@@ -43,5 +43,4 @@ export class UrlController {
clearInterval(this.interval) clearInterval(this.interval)
this.interval = null this.interval = null
} }
}
}

View File

@@ -1,3 +1,3 @@
export function getChatBody() { export function getChatBody() {
return document.getElementsByClassName("_im_peer_history im-page-chat-contain")[0]; return document.getElementsByClassName("_im_peer_history im-page-chat-contain")[0];
} }

View File

@@ -6,7 +6,6 @@ module.exports = {
devtool: "inline-source-map", devtool: "inline-source-map",
entry: { entry: {
dom: './src/dom/main.js', dom: './src/dom/main.js',
background: './src/background/background.js',
popup: './src/popup/popup.js' popup: './src/popup/popup.js'
}, },
output: { output: {
@@ -28,18 +27,23 @@ module.exports = {
{ {
test: /\.css$/i, test: /\.css$/i,
use: ['style-loader', 'css-loader'], use: ['style-loader', 'css-loader'],
} },
{
test: /\.svg$/i,
use: 'raw-loader',
},
] ]
}, },
plugins: [new HtmlWebpackPlugin({ plugins: [
template: "./src/popup/popup.html", new HtmlWebpackPlugin({
filename: "popup.html", template: "./src/popup/popup.html",
chunks: ['popup'] filename: "popup.html",
}), chunks: ['popup']
new HtmlWebpackPlugin({ }),
template: "./src/donate.html", new HtmlWebpackPlugin({
filename: "donate.html", template: "./src/donate.html",
chunks: ['donate'] filename: "donate.html",
})] chunks: ['donate']
})
]
} }