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:
+8
-1
@@ -158,7 +158,14 @@ function AddCollection(collection)
|
||||
|
||||
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 =>
|
||||
|
||||
@@ -2,6 +2,25 @@ chrome.browserAction.onClicked.addListener(function (tab)
|
||||
{
|
||||
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,
|
||||
{
|
||||
file: "js/aside-script.js",
|
||||
@@ -98,6 +117,9 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse)
|
||||
{
|
||||
switch (message.command)
|
||||
{
|
||||
case "openTab":
|
||||
chrome.tabs.create({ url: message.url });
|
||||
break;
|
||||
case "loadData":
|
||||
sendResponse(collections);
|
||||
break;
|
||||
|
||||
+3
-17
@@ -1,15 +1,14 @@
|
||||
{
|
||||
"name": "Tabs Aside",
|
||||
"version": "0.1",
|
||||
"version": "1.0",
|
||||
"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",
|
||||
"permissions":
|
||||
[
|
||||
"tabs",
|
||||
"unlimitedStorage",
|
||||
"<all_urls>",
|
||||
"bookmarks"
|
||||
"activeTab"
|
||||
],
|
||||
|
||||
"icons":
|
||||
@@ -22,19 +21,6 @@
|
||||
"browser_action": { "default_icon": "icons/light/empty/32.png" },
|
||||
"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":
|
||||
{
|
||||
"scripts": [ "js/background.js" ],
|
||||
|
||||
Reference in New Issue
Block a user