Skip to content

Commit

Permalink
Fix chrome build
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed May 15, 2024
1 parent 4f61215 commit e73126d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,25 @@ const js = function() {
/* stats options */
})
)

resolve()
})
)
}

const fixupBgScript = async function () {
const bgScript = fs.readFileSync(paths.distJs + '/background-script.js', 'utf8')
const addition = `
if ("undefined"!=typeof self && 'importScripts' in self) {
self.importScripts('./79.js')
self.importScripts('./88.js')
self.importScripts('./206.js')
self.importScripts('./895.js')
self.importScripts('./80.js')
}
`
fs.writeFileSync(paths.distJs + '/background-script.js', addition + bgScript)
}

const html = function() {
return Promise.all([
gulp.src(paths.nativeHTML).pipe(gulp.dest('./dist/')),
Expand Down Expand Up @@ -146,7 +159,7 @@ const thirdparty = gulp.parallel(mocha)

const assets = gulp.parallel(html, thirdparty, icons)

const build = gulp.series(cleanJs, js, assets)
const build = gulp.series(cleanJs, js, fixupBgScript, assets)

const main = gulp.series(build, native)

Expand Down Expand Up @@ -243,6 +256,7 @@ exports.publish = publish
exports.build = build
exports.native = native
exports.package = gulp.parallel(firefoxZip, chromeZip, xpi)
exports.fixupBgScript = fixupBgScript
/*
* Define default task that can be called by just running `gulp` from cli
*/
Expand Down
2 changes: 1 addition & 1 deletion manifest.firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "floccus bookmarks sync",
"short_name": "floccus",
"version": "5.1.2",
"version": "5.1.2.1",
"description": "__MSG_DescriptionExtension__",
"icons": {
"48": "icons/logo.png",
Expand Down

0 comments on commit e73126d

Please sign in to comment.