Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added devtools #45

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/ManifestAsset.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class ManifestAsset extends Asset {
icons: this.processIcons,
options_ui: this.processOptionsUi,
options_page: this.processOptionsPage,
chrome_url_overrides: this.processURLOverrides
chrome_url_overrides: this.processURLOverrides,
devtools_page: this.processDevtoolsPage,
}

this.replaceBundleNames = bundleNameMap => {
Expand Down Expand Up @@ -263,6 +264,10 @@ class ManifestAsset extends Asset {
this.processAllIcons(icons)
}

processDevtoolsPage() {
this.ast.devtools_page = this.processSingleDependency(this.ast.devtools_page)
}

collectDependenciesForWebExtension() {
for (const nodeName of Object.keys(this.ast)) {
const processor = this.dependencyProcessors[nodeName]
Expand Down
11 changes: 11 additions & 0 deletions test/integration/web-extension/devtools.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html>

<head>
<script src="devtools/index.js"></script>
</head>

<body>
</body>

</html>
5 changes: 5 additions & 0 deletions test/integration/web-extension/devtools/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
main()

function main() {
console.log('Hello, world!')
}
3 changes: 2 additions & 1 deletion test/integration/web-extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
"default_title": "Example Web Extension",
"default_popup": "popup.html"
},
"devtools_page": "devtools.html",
"options_ui": {
"page": "options.html"
},
"web_accessible_resources": [
"inject.js"
]
}
}
3 changes: 2 additions & 1 deletion test/web-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ describe('WebExtension', () => {
{ name: 'background_script.js' },
{ name: 'content_script.css' },
{ name: 'content_script.js' },
{ name: 'devtools.html' },
{ name: 'favicon.ico' },
{ name: 'inject.js' },
{ name: 'options.html' },
{ name: 'popup.html' }
{ name: 'popup.html' },
]
})

Expand Down