Build scripts
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
const TARGET_SELECTOR = ".playbar-playback-info-bar.playback-row-section.svelte-11gjrk3";
|
||||
const INJECTED_CONTAINER_ID = "s3-audio-capture-controls";
|
||||
const SPLICE_DOMAIN_RE = /^https?:\/\/([a-z0-9-]+\.)*splice\.com(\/|$)/i;
|
||||
const TARGET_HOST = "splice.com";
|
||||
const TARGET_PATH = "/sounds/search/samples";
|
||||
const PROBE_EVENT_SOURCE = "S3_CAPTURE_PROBE";
|
||||
let knownUrls = new Set();
|
||||
let knownPerformanceUrls = new Set();
|
||||
@@ -21,7 +22,15 @@ let lastPlaybackMetaSignature = "";
|
||||
let lastPlaybackMetaApplied = false;
|
||||
|
||||
function isDomainAllowed(url) {
|
||||
return typeof url === "string" && SPLICE_DOMAIN_RE.test(url);
|
||||
if (typeof url !== "string") {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
const parsed = new URL(url);
|
||||
return parsed.protocol === "https:" && parsed.hostname === TARGET_HOST && parsed.pathname === TARGET_PATH;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isS3Url(url) {
|
||||
@@ -548,7 +557,7 @@ function ensureInlineStyles() {
|
||||
.s3-capture-button {
|
||||
border: 1px solid rgba(255, 255, 255, 0.25);
|
||||
border-radius: 4px;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
background: none !important;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
padding: 4px 8px;
|
||||
|
||||
Reference in New Issue
Block a user