1
0
mirror of https://github.com/XFox111/TabsAsideExtension.git synced 2026-04-22 07:58:01 +03:00

Fixed system tabs opening

Updated manifest permissions
This commit is contained in:
Michael Gordeev
2020-03-26 00:42:49 +03:00
parent 8a17593ea5
commit 2844eb50da
3 changed files with 34 additions and 19 deletions
+8 -1
View File
@@ -158,7 +158,14 @@ function AddCollection(collection)
list.querySelectorAll("div > div:last-child > div > span").forEach(i => list.querySelectorAll("div > div:last-child > div > span").forEach(i =>
{ {
i.onclick = function () { window.open(i.getAttribute("value"), '_blank'); }; i.onclick = function () {
chrome.runtime.sendMessage(
{
command: "openTab",
url: i.getAttribute("value")
}
);
};
}) })
document.querySelectorAll(".tabsAside.pane > section > div > div:first-child > button").forEach(i => document.querySelectorAll(".tabsAside.pane > section > div > div:first-child > button").forEach(i =>
+22
View File
@@ -2,6 +2,25 @@ chrome.browserAction.onClicked.addListener(function (tab)
{ {
if (tab.url.startsWith("http")) if (tab.url.startsWith("http"))
{ {
chrome.tabs.insertCSS(
{
file: "css/style.css",
allFrames: true,
runAt: "document_idle"
});
chrome.tabs.insertCSS(
{
file: "css/style.generic.css",
allFrames: true,
runAt: "document_idle"
});
chrome.tabs.insertCSS(
{
file: "css/style.dark.css",
allFrames: true,
runAt: "document_idle"
});
chrome.tabs.executeScript(tab.id, chrome.tabs.executeScript(tab.id,
{ {
file: "js/aside-script.js", file: "js/aside-script.js",
@@ -98,6 +117,9 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse)
{ {
switch (message.command) switch (message.command)
{ {
case "openTab":
chrome.tabs.create({ url: message.url });
break;
case "loadData": case "loadData":
sendResponse(collections); sendResponse(collections);
break; break;
+3 -17
View File
@@ -1,15 +1,14 @@
{ {
"name": "Tabs Aside", "name": "Tabs Aside",
"version": "0.1", "version": "1.0",
"manifest_version": 2, "manifest_version": 2,
"description": "Classic Microsoft Edge \"Tabs Aside\" feature for Chromium browers", "description": "Classic Microsoft Edge \"Tabs Aside\" feature for Chromium browsers",
"author": "Michael \"XFox\" Gordeev", "author": "Michael \"XFox\" Gordeev",
"permissions": "permissions":
[ [
"tabs", "tabs",
"unlimitedStorage", "unlimitedStorage",
"<all_urls>", "activeTab"
"bookmarks"
], ],
"icons": "icons":
@@ -22,19 +21,6 @@
"browser_action": { "default_icon": "icons/light/empty/32.png" }, "browser_action": { "default_icon": "icons/light/empty/32.png" },
"web_accessible_resources": [ "*" ], "web_accessible_resources": [ "*" ],
"content_scripts":
[
{
"matches": [ "<all_urls>" ],
"css":
[
"css/style.css",
"css/style.generic.css",
"css/style.dark.css"
],
"run_at": "document_idle"
}
],
"background": "background":
{ {
"scripts": [ "js/background.js" ], "scripts": [ "js/background.js" ],