aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state_impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/proxy/state_impl')
-rw-r--r--src/hydrilla/proxy/state_impl/base.py8
-rw-r--r--src/hydrilla/proxy/state_impl/concrete_state.py11
2 files changed, 14 insertions, 5 deletions
diff --git a/src/hydrilla/proxy/state_impl/base.py b/src/hydrilla/proxy/state_impl/base.py
index 7437d52..f8291d8 100644
--- a/src/hydrilla/proxy/state_impl/base.py
+++ b/src/hydrilla/proxy/state_impl/base.py
@@ -210,15 +210,15 @@ class HaketiloStateWithFields(st.HaketiloState):
best_priority = policy.priority
best_policy = policy
except Exception as e:
- return policies.ErrorBlockPolicy(error=e)
+ return policies.ErrorBlockPolicy(self.settings, error=e)
if best_policy is not None:
return best_policy
- if self.get_settings().default_allow_scripts:
- return policies.FallbackAllowPolicy()
+ if self.settings.default_allow_scripts:
+ return policies.FallbackAllowPolicy(self.settings)
else:
- return policies.FallbackBlockPolicy()
+ return policies.FallbackBlockPolicy(self.settings)
@abstractmethod
def import_items(self, malcontent_path: Path, repo_id: int = 1) -> None:
diff --git a/src/hydrilla/proxy/state_impl/concrete_state.py b/src/hydrilla/proxy/state_impl/concrete_state.py
index c28e360..2dd8810 100644
--- a/src/hydrilla/proxy/state_impl/concrete_state.py
+++ b/src/hydrilla/proxy/state_impl/concrete_state.py
@@ -113,11 +113,20 @@ def load_settings(cursor: sqlite3.Cursor) -> st.HaketiloGlobalSettings:
(default_allow_scripts, advanced_user, repo_refresh_seconds,
mapping_use_mode), = cursor.fetchall()
+ default_popup_settings = st.PopupSettings(
+ keyboard_trigger = True,
+ style = st.PopupStyle.TAB
+ )
+
return st.HaketiloGlobalSettings(
default_allow_scripts = default_allow_scripts,
advanced_user = advanced_user,
repo_refresh_seconds = repo_refresh_seconds,
- mapping_use_mode = st.MappingUseMode(mapping_use_mode)
+ mapping_use_mode = st.MappingUseMode(mapping_use_mode),
+
+ default_popup_jsallowed = default_popup_settings,
+ default_popup_jsblocked = default_popup_settings,
+ default_popup_payloadon = default_popup_settings
)
@dc.dataclass