feat: add javascript toggle controls for device previews#1480
Closed
Dailin521 wants to merge 1 commit intoresponsively-org:mainfrom
Closed
feat: add javascript toggle controls for device previews#1480Dailin521 wants to merge 1 commit intoresponsively-org:mainfrom
Dailin521 wants to merge 1 commit intoresponsively-org:mainfrom
Conversation
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.
Summary
This adds narrow JavaScript toggle controls for Responsively previews.
Root cause
Issue #490 already identified that
webpreferencesmust be set when awebviewis created, so changing the attribute on an already-mounted preview does not actually disable JavaScript. The same issue thread also documented that screenshot capture breaks while JavaScript is disabled, which left the existing screenshot actions unsafe in that mode.Changes
webviewis recreated withwebpreferences="javascript=no"Verification
npx vitest run src/renderer/store/features/javascript/index.test.ts src/renderer/components/ToolBar/Menu/Flyout/JavaScriptControls/index.test.tsx src/renderer/components/Previewer/Device/Toolbar.test.tsxnpx tsc --noEmitnpx eslint src/renderer/store/features/javascript/index.ts src/renderer/store/features/javascript/index.test.ts src/renderer/store/index.ts src/renderer/components/Previewer/index.tsx src/renderer/components/Previewer/Device/index.tsx src/renderer/components/Previewer/Device/Toolbar.tsx src/renderer/components/Previewer/Device/Toolbar.test.tsx src/renderer/components/ToolBar/index.tsx src/renderer/components/ToolBar/Menu/Flyout/index.tsx src/renderer/components/ToolBar/Menu/Flyout/JavaScriptControls/index.tsx src/renderer/components/ToolBar/Menu/Flyout/JavaScriptControls/index.test.tsx src/renderer/components/DropDown/index.tsx(no errors; a few legacy warnings remain in touched files)npm run build:renderercurrently fails in this local Windows environment before bundling because the existingdelete-source-maps/rimrafwildcard path is rejectednpx cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.renderer.dev.tscurrently falls back to the existing DLL/postinstall path and fails locally because plainyarnis not available on PATHCloses #490