mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -23,6 +23,7 @@ use compositing_traits::{CompositionPipeline, CompositorMsg, CompositorProxy};
|
|||
use constellation_traits::WindowSizeData;
|
||||
use crossbeam_channel::{Sender, unbounded};
|
||||
use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg};
|
||||
use embedder_traits::user_content_manager::UserContentManager;
|
||||
use fonts::{SystemFontServiceProxy, SystemFontServiceProxySender};
|
||||
use ipc_channel::Error;
|
||||
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
|
||||
|
@ -196,6 +197,9 @@ pub struct InitialPipelineState {
|
|||
|
||||
/// The image bytes associated with the RippyPNG embedder resource.
|
||||
pub rippy_data: Vec<u8>,
|
||||
|
||||
/// User content manager
|
||||
pub user_content_manager: UserContentManager,
|
||||
}
|
||||
|
||||
pub struct NewPipeline {
|
||||
|
@ -292,6 +296,7 @@ impl Pipeline {
|
|||
player_context: state.player_context,
|
||||
user_agent: state.user_agent,
|
||||
rippy_data: state.rippy_data,
|
||||
user_content_manager: state.user_content_manager,
|
||||
};
|
||||
|
||||
// Spawn the child process.
|
||||
|
@ -498,6 +503,7 @@ pub struct UnprivilegedPipelineContent {
|
|||
player_context: WindowGLContext,
|
||||
user_agent: Cow<'static, str>,
|
||||
rippy_data: Vec<u8>,
|
||||
user_content_manager: UserContentManager,
|
||||
}
|
||||
|
||||
impl UnprivilegedPipelineContent {
|
||||
|
@ -543,6 +549,7 @@ impl UnprivilegedPipelineContent {
|
|||
compositor_api: self.cross_process_compositor_api.clone(),
|
||||
player_context: self.player_context.clone(),
|
||||
inherited_secure_context: self.load_data.inherited_secure_context,
|
||||
user_content_manager: self.user_content_manager,
|
||||
},
|
||||
layout_factory,
|
||||
Arc::new(self.system_font_service.to_proxy()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue