diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-10-21 21:42:56 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-10-21 21:42:56 +0200 |
commit | fe43bd552aaacd649b0e00afada01d07ad8dae9a (patch) | |
tree | 6244f66250706ec0d4a7dae23e270aefc97b02dd /src/hydrilla/proxy/policies/rule.py | |
parent | d4895218cf8a3a16b74f42c530d78106062cf95b (diff) | |
download | haketilo-hydrilla-fe43bd552aaacd649b0e00afada01d07ad8dae9a.tar.gz haketilo-hydrilla-fe43bd552aaacd649b0e00afada01d07ad8dae9a.zip |
[proxy] facilitate injecting non-payload script to all pages
Diffstat (limited to 'src/hydrilla/proxy/policies/rule.py')
-rw-r--r-- | src/hydrilla/proxy/policies/rule.py | 8 |
1 files changed, 6 insertions, 2 deletions
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) |