mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Devtools: initial Debugger > Sources panel (#36164)
This patch adds support for listing scripts in the Sources panel. Classic scripts, both external and inline, are implemented, but worker scripts and imported module scripts are not yet implemented. For example: ```html <!-- sources.html --> <!doctype html><meta charset=utf-8> <script src="classic.js"></script> <script> console.log("inline classic"); new Worker("worker.js"); </script> <script type="module"> import module from "./module.js"; console.log("inline module"); </script> <script src="https://servo.org/js/load-table.js"></script> ``` ```js // classic.js console.log("external classic"); ``` ```js // worker.js console.log("external classic worker"); ``` ```js // module.js export default 1; console.log("external module"); ```  --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes partially implement #36027 <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes require tests, but they are blocked on #36325 Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
parent
40655cc06c
commit
95eedb997a
6 changed files with 143 additions and 7 deletions
|
@ -103,6 +103,9 @@ pub enum ScriptToDevtoolsControlMsg {
|
|||
|
||||
/// Report a page title change
|
||||
TitleChanged(PipelineId, String),
|
||||
|
||||
/// Get source information from script
|
||||
ScriptSourceLoaded(PipelineId, SourceInfo),
|
||||
}
|
||||
|
||||
/// Serialized JS return values
|
||||
|
@ -543,3 +546,9 @@ impl fmt::Display for ShadowRootMode {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct SourceInfo {
|
||||
pub url: ServoUrl,
|
||||
pub external: bool,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue