From fe43bd552aaacd649b0e00afada01d07ad8dae9a Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 21 Oct 2022 21:42:56 +0200 Subject: [proxy] facilitate injecting non-payload script to all pages --- src/hydrilla/proxy/policies/rule.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/hydrilla/proxy/policies/rule.py') diff --git a/src/hydrilla/proxy/policies/rule.py b/src/hydrilla/proxy/policies/rule.py index c62f473..2a6d8cb 100644 --- a/src/hydrilla/proxy/policies/rule.py +++ b/src/hydrilla/proxy/policies/rule.py @@ -52,6 +52,10 @@ class BlockPolicy(base.Policy): priority: t.ClassVar[base.PolicyPriority] = base.PolicyPriority._TWO + @property + def current_popup_settings(self) -> state.PopupSettings: + return self.haketilo_settings.default_popup_jsblocked + def _csp_to_clear(self, http_info: http_messages.FullHTTPInfo) \ -> t.Sequence[str]: return script_csp_directives @@ -94,7 +98,7 @@ class RuleBlockPolicyFactory(RulePolicyFactory): def make_policy(self, haketilo_state: state.HaketiloState) \ -> RuleBlockPolicy: """....""" - return RuleBlockPolicy(self.pattern) + return RuleBlockPolicy(haketilo_state.get_settings(), self.pattern) @dc.dataclass(frozen=True, unsafe_hash=True) # type: ignore[misc] @@ -103,4 +107,4 @@ class RuleAllowPolicyFactory(RulePolicyFactory): def make_policy(self, haketilo_state: state.HaketiloState) \ -> RuleAllowPolicy: """....""" - return RuleAllowPolicy(self.pattern) + return RuleAllowPolicy(haketilo_state.get_settings(), self.pattern) -- cgit v1.2.3