Fix: убрать blob: из CSP для Chrome - #26
Merged
Merged
Conversation
Chrome Manifest V3 prohibits 'blob:' in script-src CSP directive for extension pages, causing the extension to fail loading with: "Insecure CSP value blob: in directive script-src" Removed blob: from content_security_policy.extension_pages in manifest.chrome.json. User plugins now load via sandbox iframe fallback instead of blob URL. Firefox manifest is unchanged. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
ivanvit100
approved these changes
Aug 31, 2026
ivanvit100
left a comment
Owner
There was a problem hiding this comment.
Благодарю за интерес к проекту и столь подробный PR!
Разработка ведётся в первую очередь под firefox, поведение в chromium тестируется только на финальных стадиях. Спасибо, что нашли и решили такую критичную проблему!
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.
Проблема
При загрузке расширения в Chrome/Chromium расширение не загружается:
Chrome в Manifest V3 запрещает
blob:вscript-srcCSP для страниц расширения.Причина
В
manifest.chrome.jsonCSP содержитblob::Это используется
PluginManager._injectFromBlob()для динамического импорта плагинов через blob URL.Решение
Убран
blob:из CSP только для Chrome. Вmanifest.firefox.jsonblob:оставлен — Firefox его поддерживает.Влияние на функциональность
В
PluginManager._loadViaSW()есть цепочка фолбэков:chrome.scripting.executeScript()— приоритетный метод_injectScript()— загрузка изplugin-runtime/{key}.js_injectFromBlob()— blob URL (пропускается в Chrome)_createSandbox()— sandbox iframeПри удалении
blob:Chrome использует sandbox-iframe для загрузки плагинов — это работает корректно.Тесты
Все 1280 тестов проходят ✅ (36 файлов тестов)