add response modifier to prevent the removal of elements by paywall script

This commit is contained in:
Kevin Pham
2023-12-01 21:36:51 -06:00
parent d9714fb449
commit dcdf75bad2
3 changed files with 82 additions and 5 deletions

View File

@@ -33,23 +33,23 @@ func NewProxySiteHandler(opts *ProxyOptions) fiber.Handler {
SetRequestModifications(
// rx.SpoofJA3fingerprint(ja3, "Googlebot"),
// rx.MasqueradeAsFacebookBot(),
rx.MasqueradeAsGoogleBot(),
//rx.MasqueradeAsGoogleBot(),
rx.DeleteOutgoingCookies(),
rx.ForwardRequestHeaders(),
//rx.SpoofReferrerFromGoogleSearch(),
rx.SpoofReferrerFromLinkedInPost(),
// rx.RequestWaybackMachine(),
// rx.RequestArchiveIs(),
//rx.RequestWaybackMachine(),
//rx.RequestArchiveIs(),
).
AddResponseModifications(
tx.InjectScriptBeforeDOMContentLoaded(`(() => {let d = document.createElement("div"); d.id = "adb-check"; document.body.append(d) })()`),
tx.ForwardResponseHeaders(),
tx.BypassCORS(),
tx.BypassContentSecurityPolicy(),
// tx.DeleteIncomingCookies(),
tx.RewriteHTMLResourceURLs(),
tx.PatchDynamicResourceURLs(),
tx.PatchTrackerScripts(),
tx.PatchDynamicResourceURLs(),
tx.BlockElementRemoval(".article-content"),
// tx.SetContentSecurityPolicy("default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"),
).
Execute()