# xpath-query-tool **Repository Path**: luopub/xpath-query-tool ## Basic Information - **Project Name**: xpath-query-tool - **Description**: Chrome扩展程序,在网页查询xpath结果 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-05-17 - **Last Updated**: 2025-10-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # XPath Query Tool Browser Extension A Chrome extension that allows evaluating XPath queries on web pages with real-time results. ![Extension Screenshot](images/screenshot-1.png) ## Features - Interactive XPath query panel - Real-time evaluation as you type - Save frequently used queries with custom names - Load saved queries with one click - Copy results to clipboard - Shows count of matched nodes - Handles both text nodes and attributes - Isolated UI in shadow DOM to avoid conflicts ## Installation 1. Download or clone this repository 2. Open Chrome and go to `chrome://extensions` 3. Enable "Developer mode" (toggle in top right) 4. Click "Load unpacked" and select the extension directory ## Usage 1. Navigate to any web page 2. Click the XPath Query Tool extension icon 3. The query panel will appear at the top of the page 4. Enter an XPath query in the input box 5. Results appear instantly in the output area 6. Use the buttons to: - Clear the current query - Copy results to clipboard - Save the current query (prompts for name) ## Saved Queries - Saved queries appear in a table below the input area - Click "Select" to load a saved query - Click "Delete" to remove a saved query ## Technical Notes - Queries are evaluated against a clone of the original page body - The panel uses shadow DOM to avoid CSS conflicts - Saved queries are stored in Chrome's local storage - Automatically appends `//text()` to queries unless targeting attributes ## Known Limitations - Complex XPath queries may impact performance - Results are limited to text nodes and attributes - Panel height is fixed (may obscure page content)