UI-Less Parser(跳过IE脚本执行-自解)

本文介绍了一种通过跟踪MSHTML的READYSTATE来确保文档加载完成的方法。主机应用通过实现IPropertyNotifySink接口并连接到MSHTML的标准连接点接口来监测文档加载状态。当文档加载完成并达到READYSTATE_COMPLETE状态时,可以通过禁用脚本执行等功能来进一步控制MSHTML的行为。
To successfully walk the HTML Scripting Object Model that the parser exposes after loading the specified document, the host application must wait until MSHTML has finished loading the document. To track MSHTML's  READYSTATE, the host implements a simple COM object that exposes IPropertyNotifySink. The host application connects to MSHTML using the standard connection point interfaces. As MSHTML loads the document it's readiness state changes. To notify the host of these changes, it executes IPropertyNotifySink.OnChanged passing along the DISPID of the property that has changed (DISPID_READYSTATE). The host uses MSHTML's automation interface obtained at creation time to retrieve the current value of this property. When the value equals READYSTATE_COMPLETE, MSHTML has finished loading the document.

If the loaded document is an HTML page which contains scripts, Java Applets and/or ActiveX controls, and those scripts are coded for immediate execution, MSHTML will
execute them by default. To disable this feature, the host must implement two additional interfaces: IOleClientSite and IDispatch. At initialization time, after MSHTML is instantiated, the host should query MSHTML for its IOleObject interface, pass MSHTML a reference to its IOleClientSite interface, query MSHTML for its IOleControl
interface, and call OnAmbientPropertyChange(DISPID_AMBIENT_DLCONTROL). MSHTML will in turn query the host's IOleClientSite interface for IDispatch and then request the value of this property from the host. This is the hosts opportunity to control MSHTML, disabling the execution of scripts, etc.
git commit -m "数据库配置页面" > TOOL@5.2.0 lint-staged /Users/10280281/growth-qa-front > lint-staged ✔ Preparing lint-staged... ⚠ Running tasks for staged files... ❯ .lintstagedrc — 5 files ❯ *.{md,json} — 2 files ✖ prettier --cache --write [ENOENT] ↓ *.{css,less} — no files ↓ *.{js,jsx} — no files ❯ *.ts?(x) — 2 files ✖ npx @shined/doctor [KILLED] ◼ eslint --fix ◼ prettier --cache --parser=typescript --write ↓ Skipped because of errors from tasks. ✔ Reverting to original state because of errors... ✔ Cleaning up temporary files... ✖ prettier --cache --write failed without output (ENOENT). ✖ npx @shined/doctor failed without output (KILLED).  ELIFECYCLE  Command failed with exit code 1. husky - pre-commit script failed (code 1) 帮我看下到底为什么 这是我的{ "name": "TOOL", "version": "5.2.0", "private": true, "description": "用增测试工具", "repository": { "type": "git", "url": "" }, "license": "ISC", "author": "SHEIN UGrowth", "scripts": { "analyze": "cross-env ANALYZE=1 max build", "build": "NODE_ENV=production sh build.sh", "build:gray": "cross-env UMI_ENV=igray max build", "build:prod": "cross-env UMI_ENV=iprod max build", "build:test": "cross-env UMI_ENV=itest max build", "dev": "pnpm run start:dev", "doctor": "npx @shined/doctor", "format": "prettier --cache --write .", "i18n-remove": "pro i18n-remove --locale=zh-CN --write", "postinstall": "max setup", "lint": "pnpm run postinstall && pnpm run lint:js && pnpm run lint:style && pnpm run lint:prettier && pnpm run tsc", "lint-staged": "lint-staged", "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx && pnpm run lint:style", "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx", "lint:prettier": "prettier -c --write \"src/**/*\" --end-of-line auto", "lint:style": "stylelint --fix \"src/**/*.less\" --syntax less", "openapi": "UMI_ENV=openapi max openapi", "playwright": "playwright install && playwright test", "prepare": "husky", "prettier": "prettier -c --write \"src/**/*\"", "serve": "umi-serve", "start": "cross-env REACT_APP_ENV=local UMI_ENV=dev max dev", "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev", "start:no-mock": "cross-env MOCK=none UMI_ENV=dev max dev", "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev max dev", "start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev max dev", "start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev", "test": "max test", "test:component": "max test ./src/components", "test:e2e": "node ./tests/run-tests.js", "tsc": "tsc --noEmit" }, "dependencies": { "@ant-design/icons": "4.8.3", "@ant-design/moment-webpack-plugin": "^1.0.0", "@ant-design/pro-components": "2.8.7", "@arco-design/web-react": "^2.66.5", "@dnd-kit/core": "^6.3.1", "@dnd-kit/sortable": "^10.0.0", "@dnd-kit/utilities": "^3.2.2", "@monaco-editor/react": "^4.7.0", "@shein-components/avatar-robot": "^1.1.3", "@shein-components/rule-graph": "^0.0.2", "@shein-ugrowth/dynamic-modules": "4.1.15", "@shein-ugrowth/game-dejavu": "^0.1.9", "@umijs/max": "^4.4.10", "@umijs/max-plugin-openapi": "^2.0.3", "@umijs/plugins": "^4.4.10", "@umijs/preset-umi": "^4.0.48", "antd": "5.25.1", "big.js": "^6.2.1", "classnames": "^2.3.0", "cross-env": "7.0.0", "cross-port-killer": "^1.3.0", "dom-to-image-more": "^3.6.0", "eslint": "^9.27.0", "form-render": "^2.4.8", "husky": "^9.1.7", "jiti": "^2.4.2", "lint-staged": "^13", "lodash-es": "^4.17.21", "mockjs": "^1.1.0", "moment": "^2.30.1", "prettier": "^3.5.3", "prettier-plugin-organize-imports": "^3.2.2", "prettier-plugin-packagejson": "^2.4.3", "qrcode.react": "^3.1.0", "query-string": "^8.2.0", "rc-menu": "^9.16.1", "react": "^18.2.0", "react-color": "^2.19.3", "react-dom": "^18.2.0", "react-helmet-async": "^1.2.0", "react-quill": "^2.0.0", "react-redux": "^8.1.3", "rrc-loader-helper": "^9.2.1", "sheinq": "^2.0.28", "swagger-ui-dist": "^5.21.0", "typescript": "^5.8.3", "xss": "^1.0.15" }, "devDependencies": { "@playwright/test": "^1.17.0", "@shined/doctor": "^0.0.50", "@shined/eslint": "^0.0.0-snapshot.13", "@types/big.js": "^6.2.2", "@types/express": "^4.17.0", "@types/history": "^4.7.0", "@types/jest": "^26.0.0", "@types/lodash-es": "^4.17.12", "@types/react": "^18.3.21", "@types/react-color": "^3.0.11", "@types/react-dom": "^18.3.7", "@types/react-helmet": "^6.1.0", "eslint": "^9.34.0", "prettier": "^3.6.2", "typescript": "^5.9.2" }, "packageManager": "pnpm@8.15.4", "engines": { "node": ">=12.0.0" }, "pnpm": { "overrides": { "@ant-design/icons": "4.8.3", "@ant-design/pro-components": "2.8.7", "antd": "5.25.1", "rc-tabs": "15.6.1" }, "patchedDependencies": { "@umijs/preset-umi@4.4.10": "patches/@umijs__preset-umi@4.4.10.patch", "rc-tabs@15.6.1": "patches/rc-tabs@15.6.1.patch" } } }
09-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值