Skip to content

Commit

Permalink
Start on browser popup.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeWannacott committed May 6, 2023
1 parent 7d7351f commit b404ca2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ console.log("tables", tables);
let tables2 = Array.from(tables).map((table) => {
return table.classList.add("table-sort");
});
console.log("tables2", tables2);



7 changes: 7 additions & 0 deletions browser-extension/getTableHeaders.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// let tables = document.querySelectorAll("table").querySelectorAll("th");
// console.log("tables3", tables);
let headers = document.querySelectorAll("table th");
console.log("tables3", headers);

let headerText = headers.map((header)=>header.innerHTML)
console.log(headerText)
Binary file removed browser-extension/icons/border-48.png
Binary file not shown.
Binary file added browser-extension/icons/t.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 12 additions & 3 deletions browser-extension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,24 @@
"description": "Makes tables sortable using https://github.com/LeeWannacott/table-sort-js",

"icons":
{ "48": "icons/border-16.png" }
{ "48": "icons/t.png" }
,

"content_scripts": [
{
"matches": [
"<all_urls>",
"*://*.mozilla.org/*",
"https://github.com/*/*/actions/runs/*/usage"
],
"js": ["getTables.js","table-sort.js"]
"js": ["addTableSortClass.js","getTableHeaders.js","table-sort.js"]
}
]
],

"browser_action": {
"default_icon": "./icons/t.png",
"default_title": "table-sort",
"default_popup": "popup/table-options.html"
}

}
15 changes: 15 additions & 0 deletions browser-extension/popup/table-options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Popup</title>
</head>
<body>
<div id="popup-content">
<button>table1</button>
<button>table2</button>
<button>table3</button>
<button>table4</button>
</body>
</html>

0 comments on commit b404ca2

Please sign in to comment.