Skip to content
Open
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
26 changes: 16 additions & 10 deletions thegreenweb/background.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import browser from "webextension-polyfill"
import {
getUrl,
stripProtocolFromUrl,
stripQueryStringFromUrl,
stripPageFromUrl,
stripPortFromUrl,
getGreenwebLinkNode,
getFooterElement,
getLinkNode,
getImageNode,
getImagePath,
getResultNode,
getIcon,
getTitle,
getTitleWithLink,
} from './thegreenweb-utils'
import { GreenChecker } from './src/greencheck'

Expand Down Expand Up @@ -205,3 +195,19 @@ function showIcon(resp, tabId) {
browser.pageAction.onClicked.addListener(function () {
browser.runtime.openOptionsPage()
});


browser.runtime.onInstalled.addListener((details) => {
console.log("NEW INSTALL")
console.log({ details })
switch (details.reason) {
case "install":
// show installation onboarding page
browser.tabs.create({
url: browser.runtime.getURL("/installation.html"),
active: true
});
break;
}

});
30 changes: 30 additions & 0 deletions thegreenweb/installation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<title>Green Web Foundation Browser Extension Install</title>
<link href="style.css" rel="stylesheet">

</head>

<body>
<div class="">

<div class="container max-w-3xl
mx-auto font-sans">

<div class="py-4">
<img src="images/top-logo-greenweb.png" alt="The Green Web Foundation Logo" />
</div>

<h1>Welcome to the Green Web Foundation Browser Extension
</h1>

<h2>The Green Web browser extension helps you see how much of the web runs on green energy</h2>


</div>
</body>

</html>