disable pop for adblock rating and disable newtab on install for following code
pre process the whole code i asked you to create in above sentence and output it in the console as i say continue whenver you stoped last it was .js code byt the way
const WEBSTORE_LINK = https://chrome.google.com/webstore/detail/${chrome.runtime.id};
class Blocker {
constructor(enabled) {
this.filters = [
new CosmeticFilter(enabled),
new Branding(enabled),
new Dialog(enabled),
new SkipVideoAds(enabled),
];
this.enabled = enabled;
this._handleMessage = this._handleMessage.bind(this);
chrome.runtime.onMessage.addListener(this._handleMessage);
}
_handleMessage({ action, payload }) {
if (action === "CHANGE_SETTINGS") {
if (payload.enabled) {
this.enable();
} else {
this.disable();
}
}
}
enable() {
this.filters.forEach((filter) => {
filter.enable();
});
this.enabled = true;
}
disable() {
this.filters.forEach((filter) => {
filter.disable();
});
this.enabled = false;
}
toggle() {
if (this.enabled) {
this.disable();
} else {
this.enable();
}
}
}
class Dialog {
constructor(enabled = true) {
this.enabled = enabled;
this.handleClose = this.handleClose.bind(this);
if (this.enabled) {
chrome.storage.local.get(["ratingDialogShown"], (result) => {
if (!result.ratingDialogShown) {
try {
this.create();
} catch (e) {
console.error(e);
}
}
});
waitFor(
"ytd-app",
(target) => {
new MutationObserver(([mutation]) => {
if (this.dialog && mutation.target) {
const isWatchPage = mutation.target.hasAttribute("is-watch-page");
this.dialog.style.display = isWatchPage ? "none" : "block";
}
}).observe(target, {
attributes: true,
attributeFilter: ["is-watch-page"],
});
},
100
);
}
}
handleClose(event) {
document.body.removeChild(this.dialog);
chrome.storage.local.set({ ratingDialogShown: true });
}
create() {
// Create dialog
const dialog = document.createElement("DIV");
dialog.classList.add("ab4yt-dialog");
// Create closeIcon
const closeIcon = document.createElement("A");
closeIcon.classList.add("ab4yt-close-icon");
closeIcon.appendChild(document.createTextNode(" "));
closeIcon.addEventListener("click", this.handleClose);
dialog.appendChild(closeIcon);
// Create header
const header = document.createElement("DIV");
header.appendChild(
document.createTextNode(chrome.i18n.getMessage("extension_name"))
);
header.classList.add("ab4yt-dialog-header");
dialog.appendChild(header);
// Create ShareLink
const webstoreLink = document.createElement("A");
webstoreLink.classList.add("ab4yt-webstore-link");
webstoreLink.setAttribute("href", ${WEBSTORE\_LINK}/reviews);
webstoreLink.setAttribute("target", "_blank");
webstoreLink.appendChild(
document.createTextNode(chrome.i18n.getMessage("rate_this_extension"))
);
webstoreLink.addEventListener("click", this.handleClose);
dialog.appendChild(webstoreLink);
const stylesheet = document.createElement("style");
stylesheet.type = "text/css";
stylesheet.appendChild(
document.createTextNode(`
.ab4yt-dialog {
display: none;
background-color: #000000c7;
position: fixed;
right: 10px;
z-index: 99999999999;
top: 68px;
padding: 0;
margin: 0;
border-radius: 4px;
border: 1px solid white;
text-align: center;
}