mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Allow setting userscripts directly without the need of files (#35388)
* Allow settings userscripts through preferences Signed-off-by: Tony <legendmastertony@gmail.com> * mach fmt instead of cargo fmt Signed-off-by: Tony <legendmastertony@gmail.com> * Fix pref loading not working for array values Signed-off-by: Tony <legendmastertony@gmail.com> * Use pref! in userscripts instead Signed-off-by: Tony <legendmastertony@gmail.com> * Implement the model jdm suggested - Remove userscripts from all places and move it to servoshell - Add in `UserContentManager` struct and passing it through `Servo::new` all the way down to script thread Signed-off-by: Tony <legendmastertony@gmail.com> * Apply suggestions from code review and format Signed-off-by: Tony <legendmastertony@gmail.com> * Revert unrelated change Signed-off-by: Tony <legendmastertony@gmail.com> --------- Signed-off-by: Tony <legendmastertony@gmail.com> Signed-off-by: Tony <68118705+Legend-Master@users.noreply.github.com>
This commit is contained in:
parent
53a2e61fec
commit
5a76906d64
16 changed files with 143 additions and 51 deletions
|
@ -119,6 +119,7 @@ use devtools_traits::{
|
|||
ScriptToDevtoolsControlMsg,
|
||||
};
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use embedder_traits::user_content_manager::UserContentManager;
|
||||
use embedder_traits::{
|
||||
Cursor, EmbedderMsg, EmbedderProxy, ImeEvent, InputEvent, MediaSessionActionType,
|
||||
MediaSessionEvent, MediaSessionPlaybackState, MouseButton, MouseButtonAction, MouseButtonEvent,
|
||||
|
@ -471,6 +472,9 @@ pub struct Constellation<STF, SWF> {
|
|||
/// Read during startup and provided to image caches that are created
|
||||
/// on an as-needed basis, rather than retrieving it every time.
|
||||
rippy_data: Vec<u8>,
|
||||
|
||||
/// User content manager
|
||||
user_content_manager: UserContentManager,
|
||||
}
|
||||
|
||||
/// State needed to construct a constellation.
|
||||
|
@ -523,6 +527,9 @@ pub struct InitialConstellationState {
|
|||
|
||||
#[cfg(feature = "webgpu")]
|
||||
pub wgpu_image_map: WGPUImageMap,
|
||||
|
||||
/// User content manager
|
||||
pub user_content_manager: UserContentManager,
|
||||
}
|
||||
|
||||
/// Data needed for webdriver
|
||||
|
@ -739,6 +746,7 @@ where
|
|||
active_media_session: None,
|
||||
user_agent: state.user_agent,
|
||||
rippy_data,
|
||||
user_content_manager: state.user_content_manager,
|
||||
};
|
||||
|
||||
constellation.run();
|
||||
|
@ -982,6 +990,7 @@ where
|
|||
player_context: WindowGLContext::get(),
|
||||
user_agent: self.user_agent.clone(),
|
||||
rippy_data: self.rippy_data.clone(),
|
||||
user_content_manager: self.user_content_manager.clone(),
|
||||
});
|
||||
|
||||
let pipeline = match result {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue