\n
\n ';
// src/logo.svg
var logo_default = 'data:image/svg+xml,%0A';
// src/notify.ts
window.scriptStatus = {
notifyCount: 0
};
var BypassElement = class extends HTMLElement {
static get observedAttributes() {
return ["text", "title", "is-help"];
}
constructor() {
super();
const shadow = this.attachShadow({ mode: "open" });
const div = document.createElement("div");
div.innerHTML = notify_element_default;
const style = document.createElement("style");
style.textContent = notify_default;
shadow.appendChild(style);
shadow.appendChild(div);
shadow.getElementById("bypass-notification").style.opacity = "0";
shadow.getElementById("version").innerText = config.releaseTag;
const logoImg = shadow.querySelector("img#bypass-logo");
logoImg.onload = () => {
shadow.getElementById("bypass-notification").style.opacity = "1";
};
logoImg.src = logo_default;
}
connectedCallback() {
this.updateContent();
}
attributeChangedCallback(name, oldValue, newValue) {
this.updateContent();
}
updateContent() {
const text = this.getAttribute("text") || "";
const title = this.getAttribute("title") || "";
const isHelp = this.hasAttribute("is-help");
const hideLinks = this.hasAttribute("hide-links");
if (isHelp || hideLinks) {
this.shadowRoot.getElementById("links").remove();
}
this.shadowRoot.getElementById("help").style.display = isHelp ? "block" : "none";
this.shadowRoot.querySelector("#title").textContent = title;
this.shadowRoot.querySelector("#text").textContent = text;
}
};
customElements.define("bypass-notification", BypassElement);
var setupNotifications = () => {
const style = document.createElement("style");
style.textContent = notify_default;
document.head.appendChild(style);
const tray = document.createElement("div");
tray.id = "bypass-tray";
tray.classList.add("notification-tray");
document.body.appendChild(tray);
};
var notify = ({ text, title, isHelp, hideLinks }) => {
if (!document.getElementById("bypass-tray")) {
setupNotifications();
}
const titleContent = title || "Bypass in progress...";
const textContent = text || "Please wait while we redirect you";
const notificationElement = document.createElement("bypass-notification");
notificationElement.setAttribute("title", titleContent);
notificationElement.setAttribute("text", textContent);
if (hideLinks) {
notificationElement.setAttribute("hide-links", "true");
}
if (isHelp) {
notificationElement.setAttribute("is-help", "true");
}
document.getElementById("bypass-tray").appendChild(notificationElement);
};
// src/fetch.ts
var jsonFetch = async (url, options) => {
return new Promise((resolve, reject) => {
UserScript.xmlHttpRequest({
method: options.method,
data: options.data ? JSON.stringify(options.data) : void 0,
headers: options.headers,
url,
onload: (response) => {
if (response.responseText && typeof response.responseText === "string") {
try {
const data = JSON.parse(response.responseText);
resolve(data);
} catch (e) {
reject();
}
} else {
reject();
}
},
onerror: reject,
ontimeout: reject,
onabort: reject,
timeout: 5e3
});
});
};
// src/ping.ts
var ping = async () => {
try {
const data = await jsonFetch(
`${"https://bypass.city"}/.well-known/ping.json`,
{
method: "GET",
headers: {
"Content-Type": "application/json"
}
}
);
return data.ping;
} catch (e) {
return false;
}
};
// src/linkvertise.ts
var linkvertiseListener = async () => {
if (!matchLinkvertise(window.location.href)) {
return;
}
const bypassData = await WrappedGet("bypass.data");
if (bypassData) {
notify({});
await sleep(6e3);
const targetUrl = bypassData.bypassData;
await UserScript.deleteValue("bypass.data");
await sleep(1);
window.open(targetUrl, "_self");
} else if (!/(https?:\/\/linkvertise\.com\/?$)/g.test(window.location.href)) {
let redirectBase = "https://bypass.city";
const isPing = await ping();
if (!isPing) {
redirectBase = "https://adbypass.org";
}
notify({});
await UserScript.deleteValue("bypass.data");
const bypassCityUrl = new URL(`${redirectBase}/bypass`);
bypassCityUrl.searchParams.set("bypass", window.location.href);
bypassCityUrl.searchParams.set("userscript", "true");
bypassCityUrl.searchParams.set("userscript-version", config.version);
window.open(bypassCityUrl.href, "_self");
}
};
var matchLinkvertise = (url) => {
const regex = /^https?:\/\/(linkvertise\.(com|download)|(link-(center|target|hub|to)|direct-link|file-link)\.net)/i;
return regex.test(url) && !url.startsWith("https://linkvertise.com/profile") && !url.startsWith("https://linkvertise.com/login");
};
// src/main.ts
(async () => {
console.info("Linkvertise Userscript", config.version, window.location.href);
await bypassCityListener();
await linkvertiseListener();
})();
})();
\n
\n \n \n \n
\n
\n \n \n
\n \n \n Get Support on our Discord\n
\n