The data: URI kitchen

本文介绍了一种通过特定页面获取ContentDisposition链接中数据的方法。具体步骤包括:访问指定页面,设置类型为application/x-javascript;charset=utf-8,并启用base64选项;接着将链接显示的内容复制到主输入框内,最后点击生成按钮。
Try this page.
[url]http://software.hixie.ch/utilities/cgi/data/data[/url]
To get what's in the "Content Disposition" link up there, for example:
1) Go to that page.
2) Enter "application/x-javascript;charset=utf-8" next to "Type:".
3) Check "base64".
4) Copy and paste all of the text the "Content Disposition" link brings up into the main text input area.
5) Click Generate.
h3c@h3c-H3C-X5-030t:~/catkin_ws$ roslaunch wpr_simulation wpb_gmapping.launch ... logging to /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/roslaunch-h3c-H3C-X5-030t-16583.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://h3c-H3C-X5-030t:38259/ SUMMARY ======== PARAMETERS * /axis_angular: 0 * /axis_linear: 1 * /gazebo/enable_ros_network: True * /joy_node/deadzone: 0.12 * /joy_node/dev: /dev/input/js0 * /robot_description: <?xml version="1.... * /rosdistro: noetic * /rosversion: 1.17.4 * /scale_angular: 1.0 * /scale_linear: 0.5 * /use_sim_time: True NODES / bed (gazebo_ros/spawn_model) bookshelft (gazebo_ros/spawn_model) chair_0 (gazebo_ros/spawn_model) chair_1 (gazebo_ros/spawn_model) chair_2 (gazebo_ros/spawn_model) chair_3 (gazebo_ros/spawn_model) cupboard_0 (gazebo_ros/spawn_model) cupboard_1 (gazebo_ros/spawn_model) dinning_table_0 (gazebo_ros/spawn_model) dinning_table_1 (gazebo_ros/spawn_model) dinning_table_2 (gazebo_ros/spawn_model) dinning_table_3 (gazebo_ros/spawn_model) gazebo (gazebo_ros/gzserver) gazebo_gui (gazebo_ros/gzclient) joint_state_publisher (joint_state_publisher/joint_state_publisher) joy_node (joy/joy_node) kitchen_table (gazebo_ros/spawn_model) lidar_filter (wpr_simulation/lidar_filter) robot_state_publisher (robot_state_publisher/robot_state_publisher) rviz (rviz/rviz) slam_gmapping (gmapping/slam_gmapping) sofa (gazebo_ros/spawn_model) spawn_urdf (gazebo_ros/spawn_model) tea_table (gazebo_ros/spawn_model) teleop_js_node (wpr_simulation/teleop_js_node) ROS_MASTER_URI=http://localhost:11311 process[gazebo-1]: started with pid [16599] process[gazebo_gui-2]: started with pid [16604] process[bed-3]: started with pid [16608] process[sofa-4]: started with pid [16610] process[tea_table-5]: started with pid [16611] process[bookshelft-6]: started with pid [16612] process[kitchen_table-7]: started with pid [16613] process[cupboard_0-8]: started with pid [16614] process[cupboard_1-9]: started with pid [16615] process[dinning_table_0-10]: started with pid [16616] process[dinning_table_1-11]: started with pid [16617] process[dinning_table_2-12]: started with pid [16618] process[dinning_table_3-13]: started with pid [16619] process[chair_0-14]: started with pid [16623] process[chair_1-15]: started with pid [16625] process[chair_2-16]: started with pid [16626] process[chair_3-17]: started with pid [16627] process[spawn_urdf-18]: started with pid [16628] process[robot_state_publisher-19]: started with pid [16629] process[joint_state_publisher-20]: started with pid [16631] process[lidar_filter-21]: started with pid [16637] process[slam_gmapping-22]: started with pid [16647] process[rviz-23]: started with pid [16662] process[joy_node-24]: started with pid [16688] process[teleop_js_node-25]: started with pid [16701] [ERROR] [1757056623.055226400]: Couldn't open joystick /dev/input/js0. Will retry every second. INFO: cannot create a symlink to latest log directory: [Errno 17] File exists: '/home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6' -> '/home/h3c/.ros/log/latest' [INFO] [1757056623.283041076]: Finished loading Gazebo ROS API Plugin. [INFO] [1757056623.283804852]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting... [INFO] [1757056623.334556790]: Finished loading Gazebo ROS API Plugin. [INFO] [1757056623.335576156]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting... [INFO] [1757056624.063954592]: waitForService: Service [/gazebo/set_physics_properties] is now available. [ERROR] [1757056624.072195, 0.000000]: Spawn service failed. Exiting. [INFO] [1757056624.075687100, 266.729000000]: Physics dynamic reconfigure ready. Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame odom (parent map) at time 266.871000 according to authority unknown_publisher at line 277 in /tmp/binarydeb/ros-noetic-tf2-0.7.10/src/buffer_core.cpp [WARN] [1757056624.344992822, 266.821000000]: TF_REPEATED_DATA ignoring data with redundant timestamp for frame odom (parent map) at time 266.871000 according to authority unknown_publisher ../src/intel/isl/isl.c:2105: FINISHME: ../src/intel/isl/isl.c:isl_surf_supports_ccs: CCS for 3D textures is disabled, but a workaround is available. [sofa-4] process has died [pid 16610, exit code 1, cmd /opt/ros/noetic/lib/gazebo_ros/spawn_model -file /home/h3c/catkin_ws/src/wpr_simulation/models/sofa.model -x -1.0 -y -3.9 -z 0 -Y 1.57 -urdf -model sofa __name:=sofa __log:=/home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/sofa-4.log]. log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/sofa-4*.log [bed-3] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/bed-3*.log [tea_table-5] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/tea_table-5*.log [bookshelft-6] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/bookshelft-6*.log [cupboard_1-9] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/cupboard_1-9*.log [cupboard_0-8] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/cupboard_0-8*.log [kitchen_table-7] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/kitchen_table-7*.log [dinning_table_1-11] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/dinning_table_1-11*.log terminate called after throwing an instance of 'gazebo::common::Exception' [chair_0-14] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/chair_0-14*.log [dinning_table_3-13] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/dinning_table_3-13*.log [dinning_table_2-12] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/dinning_table_2-12*.log [chair_1-15] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/chair_1-15*.log [INFO] [1757056627.039204251, 268.774000000]: <initialOrientationAsReference> is unset, using default value of false to comply with REP 145 (world as orientation reference) [INFO] [1757056627.039250418, 268.774000000]: <robotNamespace> set to: // [INFO] [1757056627.039258829, 268.774000000]: <topicName> set to: imu/data [INFO] [1757056627.039264766, 268.774000000]: <frameName> set to: imu_link [INFO] [1757056627.039284535, 268.774000000]: <updateRateHZ> set to: 100 [INFO] [1757056627.039292202, 268.774000000]: <gaussianNoise> set to: 0 [INFO] [1757056627.039308366, 268.774000000]: <xyzOffset> set to: 0 0 0 [INFO] [1757056627.039324369, 268.774000000]: <rpyOffset> set to: 0 -0 0 ../src/intel/isl/isl.c:2105: FINISHME: ../src/intel/isl/isl.c:isl_surf_supports_ccs: CCS for 3D textures is disabled, but a workaround is available. [INFO] [1757056627.147319215, 268.774000000]: Camera Plugin: Using the 'robotNamespace' param: '/' [INFO] [1757056627.148798957, 268.774000000]: Camera Plugin (ns = /) <tf_prefix_>, set to "" [INFO] [1757056627.169137370, 268.774000000]: Camera Plugin: Using the 'robotNamespace' param: '/' [INFO] [1757056627.170343672, 268.774000000]: Camera Plugin (ns = /) <tf_prefix_>, set to "" [INFO] [1757056627.194344383, 268.774000000]: Camera Plugin: Using the 'robotNamespace' param: '/' [INFO] [1757056627.195809856, 268.774000000]: Camera Plugin (ns = /) <tf_prefix_>, set to "" [chair_3-17] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/chair_3-17*.log [INFO] [1757056627.287370743, 268.774000000]: Laser Plugin: Using the 'robotNamespace' param: '/' [INFO] [1757056627.287421234, 268.774000000]: Starting Laser Plugin (ns = /) [INFO] [1757056627.288334105, 268.774000000]: Laser Plugin (ns = /) <tf_prefix_>, set to "" [INFO] [1757056627.328058953, 268.774000000]: WPR using gains: yaw: 500 x: 40000 y: 30000 [INFO] [1757056627.328091266, 268.774000000]: robotBaseFrame for WPR plugin: base_footprint [dinning_table_0-10] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/dinning_table_0-10*.log Aborted (core dumped) [gazebo_gui-2] process has died [pid 16604, exit code 134, cmd /opt/ros/noetic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/gazebo_gui-2.log]. log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/gazebo_gui-2*.log Laser Pose= -1.34429e-10 1.57666e-10 -8.866e-12 [spawn_urdf-18] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/spawn_urdf-18*.log [chair_2-16] process has finished cleanly log file: /home/h3c/.ros/log/423fb52a-8a27-11f0-bbfc-d5ac9570cff6/chair_2-16*.log
09-06
<think> 我们正在讨论如何查看 data: URI(内嵌资源)来自哪个网站。data: URI 是一种将数据直接嵌入到网页中的方式,而不是从外部服务器加载。要追踪 data: URI 的来源,我们需要理解它是如何被生成的。 根据之前的讨论,data: URI 的内容是直接编码在文档中的,因此它没有独立的网络请求。但是,我们可以通过以下方法来追踪其来源: 方法1: 使用浏览器开发者工具 1. 打开开发者工具(通常按F12键),切换到“网络”选项卡。 2. 刷新页面,重新加载所有资源。 3. 在“网络”选项卡中,筛选出“文档”(Document)类型的请求,或者使用搜索框搜索“data:”可能会找到一些线索,但注意,data: URI本身不会出现在网络请求中,因为它不是通过网络加载的。 4. 由于data: URI是内嵌在HTML、CSS或JavaScript中的,我们需要查看页面源代码或相关的资源文件。 方法2: 查看页面源代码 1. 在网页上右键单击,选择“查看页面源代码”。 2. 使用搜索功能(Ctrl+F)搜索“data:image/”或“data:text/”等,这可能会帮助找到内嵌资源的位置。 3. 一旦找到,观察它所在的上下文,通常可以推断出它是被哪个脚本或样式表生成的。 方法3: 使用开发者工具的元素检查器 1. 在开发者工具中,切换到“元素”面板。 2. 选中使用了data: URI的元素(例如一个img元素,其src属性为data: URI)。 3. 在右侧的“样式”面板中,如果该data: URI是作为背景图像使用的,那么它可能会显示在CSS规则中,我们可以查看该CSS规则所在的样式表文件。 方法4: 检查脚本 如果data: URI是由JavaScript动态生成的,那么我们需要: 1. 在开发者工具中,切换到“源代码”面板,然后搜索“data:”或“createObjectURL”等关键字(因为有时也会使用Blob URL,但这里我们关注data: URI)。 2. 或者在“控制台”中设置断点,跟踪相关元素的创建过程。 方法5: 使用性能分析工具 1. 在开发者工具的“性能”选项卡中,录制页面加载过程。 2. 在录制结果中,我们可以查看各个时间点的DOM修改、脚本执行等,从而找到生成data: URI的代码。 由于data: URI是直接内嵌在文档或脚本中的,它没有独立的来源URL。因此,我们需要通过分析文档结构或脚本逻辑来确定它的来源网站。实际上,data: URI所在的网页就是它的来源网站,但有时我们可能想知道是哪个外部脚本或样式表引入了这个data: URI,那么就要按照上述方法去查找。 注意:有些data: URI是通过服务器端生成并内嵌到HTML中的,这样我们就只能从服务器返回的HTML中看到它。 示例步骤: 假设我们在一个网页中看到一个图片,其src是一个data: URI,我们想查看它来自哪里(即哪个脚本或样式表引入了它): 1. 右键点击该图片,选择“检查”。 2. 在元素面板中,我们可以看到该img元素的src属性值很长(即data: URI)。此时,我们可以查看该元素的上层结构,看是否有相关的id、class等。 3. 在右侧的“样式”面板中,查看是否有CSS规则设置了背景图片为data: URI(如果是背景图的话)。 4. 如果该图片是动态生成的,我们可以查看事件监听器,或者查看该元素所在的脚本部分。 另外,我们可以使用控制台来获取该元素的创建信息: 在控制台中,输入以下命令(以该元素为例): ```javascript // 假设该元素的id为myImage console.trace(document.getElementById('myImage')); ``` 但注意,如果该元素是动态生成的,我们可能需要查看创建它的函数。 总结:由于data: URI是内嵌的,它没有外部来源,但我们可以通过分析页面结构和脚本找到它被嵌入的位置,从而知道它是由当前网页的哪个部分(或由哪个外部资源)生成的。 相关问题: 1. 如何将data: URI保存为本地文件? 2. 如何防止网站使用data: URI来嵌入资源? 3. 在网页性能优化中,使用data: URI的优缺点是什么? 4. 如何通过浏览器扩展来查看或拦截data: URI? 引用说明: 在回答中,我们参考了data: URI的基本结构[^1]和其优缺点[^3],以及如何利用CSS和JavaScript来使用data: URI[^4]。 </think> 要查看 `data: URI`(内嵌资源)的来源网站,可通过以下方法逐步操作: ### 一、浏览器开发者工具定位法(推荐) 1. **打开开发者工具** - 在目标页面按 `F12`(Windows)或 `⌥+⌘+I`(Mac) - 切换到 **Elements** 面板 2. **定位资源元素** - 使用元素选择器(![ ](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PHBhdGggZD0iTTEwIDEwTDUgNW0wIDVsNS01TTEwIDBsLTMgM2g2eiIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+))选取包含 `data: URI` 的元素 - 示例:若为图片,查找 `<img src="data:image/png;base64,...">` 3. **分析上下文** - 在右侧 **Styles** 面板查看 CSS 规则来源文件 ![开发者工具示例](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAwIiBoZWlnaHQ9IjEwMCI+PHJlY3Qgd2lkdGg9IjMwMCIgaGVpZ2h0PSIxMDAiIGZpbGw9IiNmZmYiLz48dGV4dCB4PSIxMCIgeT0iNTAiIGZvbnQtZmFtaWx5PSJBcmlhbCI+YmFja2dyb3VuZC1pbWFnZTogdXJsKCdkYXRhOmltYWdlL3N2Zyt4bWw7YmFzZTY0Li4uJyk7PC90ZXh0Pjwvc3ZnPg==) → 显示来源:`styles.css:42`[^1] - 在 **Sources** 面板搜索 `data:` 关键字查找生成脚本 ### 二、网络请求回溯法 1. 在 **Network** 面板启用录制 2. 筛选 `Doc` 类型请求 3. 检查 **Initiator** 列: - 若显示 `parser` → 来自初始 HTML - 若显示脚本文件(如 `app.js:15`)→ 该脚本生成资源 ### 三、控制台调试法 ```javascript // 获取所有包含data: URI的元素 const dataURIs = [...document.querySelectorAll('[src^="data:"], [style*="data:image"])']; dataURIs.forEach(el => { console.log("元素:", el.tagName, "来源文件:", el.ownerDocument.location.href); }); ``` 输出示例: `<img> 来源文件: https://www.example.com/page.html` ### 四、高级工具分析 1. **性能分析器** 在 **Performance** 面板录制页面加载,查看 `Paint` 事件中的资源来源 2. **扩展辅助** 安装 [Resource Override](https://chromewebstore.google.com/detail/resource-override/pkoacgokdfckfpndoffpifphamojphii) 扩展,直接拦截并显示内嵌资源上下文 --- ### 关键原理说明 `data: URI` **本身不包含来源信息**,因其内容直接嵌入在: - HTML 标签属性(如 `<img src="data:...">`) - CSS 规则(如 `background: url(data:...)`) - JavaScript 动态生成(如 `canvas.toDataURL()`) 因此需通过**宿主文件(HTML/CSS/JS)的来源**间接确定[^3][^4]。 --- ### 相关问题 1. 如何将 `data: URI` 保存为本地文件? 2. 为什么某些网站大量使用 `data: URI`?有哪些性能影响? 3. 如何阻止浏览器加载 `data: URI` 资源? 4. `data: URI` 与 Blob URL 有何区别? [^1]: Data URI 的格式包含 MIME 类型和编码数据,但无来源信息[^1]。 [^2]: 通过优化工具生成的 `data: URI` 需回溯到原始应用位置[^2]。 [^3]: `data: URI` 主要用于减少 HTTP 请求,但无法独立缓存[^3]。 [^4]: 结合 CSS/JS 使用可间接实现资源缓存[^4
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值