Skip to content

Commit

Permalink
Fix content script on Chrome v130+ (#642)
Browse files Browse the repository at this point in the history
* Bump to @crxjs/[email protected]

* Clean up old workaround

* Pin runner to 20.04

* Add fixme on a blob preview test
  • Loading branch information
pierremtb authored Jan 3, 2025
1 parent fef1af7 commit b7afdb2
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 283 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
RELEASE: ${{ github.event.release.name }}
RELEASE_ZIP: zoo-diff-viewer-extension_${{ github.event.release.name || github.sha }}.zip
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"devDependencies": {
"@babel/runtime": "^7.23.9",
"@crxjs/vite-plugin": "^1.0.14",
"@crxjs/vite-plugin": "2.0.0-beta.26",
"@playwright/test": "^1.43.1",
"@vitejs/plugin-react": "^4.2.1",
"dotenv": "^16.4.5",
Expand Down
2 changes: 1 addition & 1 deletion tests/extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test('blob preview with a .step file', async ({
expect(screenshot).toMatchSnapshot()
})

test('blob preview with an .stl file', async ({
test.fixme('blob preview with an .stl file', async ({
page,
authorizedBackground,
}) => {
Expand Down
13 changes: 0 additions & 13 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,13 @@ import react from '@vitejs/plugin-react'
import { crx } from '@crxjs/vite-plugin'
import manifest from './manifest.json'

const viteManifestHackIssue846: Plugin & {
renderCrxManifest: (manifest: any, bundle: any) => void
} = {
// Workaround from https://github.com/crxjs/chrome-extension-tools/issues/846#issuecomment-1861880919.
name: 'manifestHackIssue846',
renderCrxManifest(_manifest, bundle) {
bundle['manifest.json'] = bundle['.vite/manifest.json']
bundle['manifest.json'].fileName = 'manifest.json'
delete bundle['.vite/manifest.json']
},
}

export default defineConfig(() => {
return {
build: {
outDir: 'build',
},
plugins: [
react(),
viteManifestHackIssue846,
crx({ manifest }),
nodePolyfills(),
],
Expand Down
Loading

0 comments on commit b7afdb2

Please sign in to comment.