Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function INSERT_OR_REMOVE(table, id) {
- if (isNaN(id))
- return;
- var parsed = parseInt(id);
- chrome.storage.local.get(table, function (data) {
- if (data[table] == null)
- data[table] = [];
- if (!data[table].includes(id))
- data[table].push(id);
- else
- data[table].remByVal(id);
- chrome.storage.local.set(data);
- });
- }
- function colorize() {
- chrome.storage.local.get("blocked", function (data) {
- var buttons = $("div.base-btn").closest("table");
- for (i = 0; i < buttons.length; i++) {
- var id = $(buttons[i]).attr("data-id");
- if (data["blocked"].includes(id))
- $(buttons[i]).parent().addClass('blocked');
- else
- $(buttons[i]).parent().removeClass('blocked');
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment