Skip to content
Snippets Groups Projects
Commit 62ed08de authored by Anton Bershanskiy's avatar Anton Bershanskiy
Browse files

Separated out browser-specific code

parent ac005abc
No related branches found
No related tags found
No related merge requests found
const platform = chrome;
\ No newline at end of file
......@@ -5,6 +5,7 @@ it only sets up the pane in Developer tools when user opens it up. -->
<head>
<meta charset="utf-8">
<title>Devtools pane</title>
<script src="/platform.js"></script>
<script src="devtools.js"></script>
</head>
</html>
\ No newline at end of file
/*
* This script is run when user opens the "Developer tools".
* Sets up the Chrome DevTools UI, inspector.html
* Sets up the DevTools UI pane.
*/
"use strict";
// Setup the DevTools panel, but only if it's enabled
chrome.storage.local.get(["DevTools"], function(result) {
platform.storage.local.get(["DevTools"], function(result) {
const draw = result.DevTools;
if (draw)
chrome.devtools.panels.create("Cookie Saver",
platform.devtools.panels.create("Cookie Saver",
"/img-t/img.png",
"/pages/popup/popup.html",
function cb(panel) {
panel.onShown.addListener(function(win){ win.focus(); });
});
});
});
\ No newline at end of file
/* TODO:
Options UI can be too tall (long vertically) for the provided pace. In that case, window can't resolve th right heght and scroll thing and just starts shaking. Fixed by setting body{height:700px}.
*/
body{height:700px}
ul {
list-style: none
}
\ No newline at end of file
......@@ -3,8 +3,10 @@
<head>
<meta charset="utf-8">
<title>Options</title>
<script src="options_ui.js"></script>
<script src="/platform.js" defer></script>
<script src="options_ui.js" defer></script>
<link rel="stylesheet" type="text/css" href="options_ui.css">
<link rel="stylesheet" type="text/css" href="options_ui_platform.css">
</head>
<body>
<h2>Permissions</h2>
......
"use strict";
const platform = chrome;
/*
* For debug purposes only. This displays the "message" within the UI.
*/
......
......@@ -5,9 +5,10 @@
<meta charset="utf-8"/>
<link href="popup.css" rel="stylesheet"/>
<link href="/includes/table-resize-master/table-resize.css" rel="stylesheet"/>
<script src="popup.js"></script>
<script src="/cookies.js"></script>
<script src="/includes/table-resize-master/table-resize.js"></script>
<script src="/platform.js" defer></script>
<script src="popup.js" defer></script>
<script src="/cookies.js" defer></script>
<script src="/includes/table-resize-master/table-resize.js" defer></script>
</head>
<body>
<h1>Cookie Saver</h1>
......
......@@ -9,17 +9,6 @@ function debugMessage(message){
document.body.appendChild(div);
}
/* Firefox and Chromium provide that same WebExtensions API,
* but Chromium calls it 'chrome.cookies' (because they invented it),
* while Firefx and Edge call it 'browser.cookies'.
*/
/* TODO: Figure out the difference between
* chrome.cookies vs browser.cookies vs document.cookie vs window.cookies
*/
//var platform = typeof(chrome)==='object' ? chrome : browser;
//var platform = browser;
var platform = chrome;
document.addEventListener('DOMContentLoaded', function() {
platform.cookies.getAll({
domain: ".com"
......
/* TODO: move this to chromium platform folder after figuring out build process */
"use strict";
const platform = chrome;
/* Firefox and Chromium provide that same WebExtensions API,
* but Chromium calls it 'chrome.cookies' (because they invented it),
* while Firefx and Edge call it 'browser.cookies'.
*/
/* TODO: Figure out the difference between
* chrome.cookies vs browser.cookies vs document.cookie vs window.cookies
*/
//var platform = typeof(chrome)==='object' ? chrome : browser;
//var platform = browser;
\ No newline at end of file
const platform = browser;
\ No newline at end of file
ul {
list-style: none
}
/* Match the page about:addons page style */
body {
font-size: 1.25rem;
color: #333;
......
const platform = chrome;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment