mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-17 00:38:59 +00:00
Add ignore list for unkown global property
This is for often-seen globals which we _know_ come from client-side libraries, e.g. litNonce.
This commit is contained in:
@@ -54,6 +54,28 @@ pub const Loader = struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (comptime builtin.mode == .Debug) {
|
if (comptime builtin.mode == .Debug) {
|
||||||
|
const ignored = std.StaticStringMap(void).initComptime(.{
|
||||||
|
.{ "process", {} },
|
||||||
|
.{ "ShadyDOM", {} },
|
||||||
|
.{ "ShadyCSS", {} },
|
||||||
|
|
||||||
|
.{ "litNonce", {} },
|
||||||
|
.{ "litHtmlVersions", {} },
|
||||||
|
.{ "litHtmlPolyfillSupport", {} },
|
||||||
|
.{ "litElementHydrateSupport", {} },
|
||||||
|
|
||||||
|
.{ "recaptcha", {} },
|
||||||
|
.{ "grecaptcha", {} },
|
||||||
|
.{ "___grecaptcha_cfg", {} },
|
||||||
|
.{ "__recaptcha_api", {} },
|
||||||
|
.{ "__google_recaptcha_client", {} },
|
||||||
|
|
||||||
|
.{ "CLOSURE_FLAGS", {} },
|
||||||
|
});
|
||||||
|
if (ignored.has(name)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
log.debug(.unknown_prop, "unkown global property", .{
|
log.debug(.unknown_prop, "unkown global property", .{
|
||||||
.info = "but the property can exist in pure JS",
|
.info = "but the property can exist in pure JS",
|
||||||
.stack = js_context.stackTrace() catch "???",
|
.stack = js_context.stackTrace() catch "???",
|
||||||
|
|||||||
Reference in New Issue
Block a user