-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathupdate-feeds.js
34 lines (33 loc) · 1.19 KB
/
update-feeds.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Update feeds
// version 2023.1.0
// https://forum.vivaldi.net/post/641164
// Custom button to update feeds from any toolbar. See linked topic for full
// instructions.
(function updateFeeds() {
let appendChild = Element.prototype.appendChild;
Element.prototype.appendChild = function () {
if (this.tagName === "BUTTON") {
setTimeout(
function () {
if (this.classList.contains("ToolbarButton-Button")) {
// make sure following title exactly matches the name of your
// command chain
if (this.title === "Update Feeds") {
this.addEventListener("click", () => {
setTimeout(() => {
// make sure following input value exactly matches the title
// of the button to update all feeds in vivaldi://settings/rss
// this is dependent on your browser language settings
document
.querySelector("input[value='Update All Feeds']")
.click();
}, 150);
});
}
}
}.bind(this, arguments[0])
);
}
return appendChild.apply(this, arguments);
};
})();