Skip to content

Commit

Permalink
Remove webpack and use straight ES6 modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
fwenzel committed Oct 24, 2021
1 parent b9c40cb commit fca5801
Show file tree
Hide file tree
Showing 9 changed files with 586 additions and 3,041 deletions.
7 changes: 7 additions & 0 deletions src/data/html/background-page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="module" src="/lib/main.js"></script>
</head>
</html>
4 changes: 2 additions & 2 deletions src/lib/discover.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import notify from './notify';
import processUrl from './shortener';
import notify from './notify.js';
import processUrl from './shortener.js';

const _ = browser.i18n.getMessage;

Expand Down
5 changes: 2 additions & 3 deletions src/lib/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import discoverUrl from './discover';
import processUrl from './shortener';
import discoverUrl from './discover.js';
import processUrl from './shortener.js';

const _ = browser.i18n.getMessage;


/** Add context menus and toolbar button. */
// per-page
browser.contextMenus.create({
Expand Down
6 changes: 2 additions & 4 deletions src/lib/notify.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const _ = browser.i18n.getMessage;

const manifest = browser.runtime.getManifest();
const addon_icon = browser.extension.getURL('data/img/icon.svg');
const addon_icon = browser.runtime.getURL('data/img/icon.svg');


export default function notify(txt) {
Expand All @@ -10,5 +8,5 @@ export default function notify(txt) {
title: manifest.name,
message: txt,
iconUrl: addon_icon
})
});
}
2 changes: 1 addition & 1 deletion src/lib/shortener.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import notify from './notify';
import notify from './notify.js';

const _ = browser.i18n.getMessage;

Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"<all_urls>"
],
"background": {
"scripts": ["dist/bundle.js"]
"page": "data/html/background-page.html"
},
"commands": {
"shorten-page-url": {
Expand Down
Loading

0 comments on commit fca5801

Please sign in to comment.