Repository navigation
feat(ui-plugins): add Web Task Extension (web-task-extension) - #247
Open
ppppp2005-p wants to merge 13 commits into
Open
ppppp2005-p wants to merge 13 commits into
ppppp2005-p wants to merge 13 commits into
Conversation
Author
|
ZCode desktop demo (ZCode 4.0.0, macOS arm64) web-task-extension-demo.mp4Flow shown:
演示流程:本地 marketplace 安装 → 确认页面结构 → |
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin type (required) / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
web-task-extension(UI Plugin, new)What / 改动内容
New community UI plugin Web Task Extension / 网页操作转浏览器扩展: a browser chore the user describes becomes steps and a Chrome / Edge Manifest V3 extension (Run-button popup, options page, minimal permissions with plain explanations). The extension is validated and zipped. Logging in is not automated.
Tools:
ext_new,ext_update(bumps the version),ext_check(re-validate the folder on disk),ext_list(read-only).ext_state.How it works:
src/task.ts, zod):open {url, newTab},click {selector, text},fill {selector, value, submit}(text,<select>by value or label, checkbox),wait {selector | ms, gone}.extract {selector, fields, into, next, maxPages, limit}, with fieldscss,css@attr,@attror..download {from, format csv|json, filename} | {selector, limit}.{{key}}; built-ins{{today}}and{{now}}.checkTaskreports errors for unknown placeholders, placeholders in an Open URL's host, non-http URLs, a download before any extract, a wait with nothing to wait for, all-sites patterns and paths outside Downloads. It warns about password-like fills and about tasks that don't start with Open.permissions()):storage+scripting;downloadsonly with a download step.sites(scheme + host; ports and paths dropped). With no Open step,activeTaband no hosts.src/runtime/ext/, plain JS copied as-is; per-task data lives intask.json, never in code):background.js:tabs.onUpdated. Each page step is injected throughchrome.scripting.executeScriptwith the self-containedpageStepfromsteps.js, which polls for elements with a timeout. React-safe value setter; input and change events.nextuntil it is missing. Column order comes fromfields, because Chrome returns objects with sorted keys.chrome.downloads.chrome.storage.local. Friendly errors: no access to a site, not a web page, load timeout, missing settings._locales/enandzh_CN, and generated PNG icons (rounded square with a play glyph, 4× supersampled, own PNG encoder).validate(), 17 checks):javascript:); every script parses (vm.Script) with no eval or remote code; locales complete, including every message used.Panel:
ext_update).Network / API / side effects: none from the plugin, and no API keys. It writes
extensions/<slug>/,extensions/<slug>-<version>.zipand.web-task-extension/extensions.json. No hooks. The generated extension makes no requests of its own.Testing:
ext_newfor the portal task: all 17 checks pass, manifest shape, icons, PERMISSIONS.md, exact zip contents; a duplicate is refused.bad_taskwith the reason.ext_updatebumps 1.0.0 → 1.0.1 and dropsdownloadswhen the download step is removed.ext_checkafter hand edits catches an inline script, an inline handler, a remote script, a syntax error, eval, a wrong icon size,tabs+<all_urls>, and writes no zip.Extensions.loadUnpacked):harbor-parts/brakes-<date>.csvwith the right columns and order, and 2 spec sheets downloaded.A ZCode Desktop demo recording is attached in the comments. / ZCode 桌面版演示录屏见评论。
Self-check / 自查清单
external_plugins/<name>/categoryis set (productivity)version0.1.0 in bothplugin.jsonandmarketplace.jsonREADME.md(EN) andREADME_CN.md(中文) both provided and equivalentdescription_i18nhas bothenandzh-CNpython3 scripts/validate.pyandpython3 scripts/build_dist.pypass locallyext_newgeneratedextensions/web-task/plus a zip and the built-in check passed 17/17; demo video in the comments)