Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: convert files to v3 #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
13 changes: 0 additions & 13 deletions background.js

This file was deleted.

20 changes: 20 additions & 0 deletions background.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const myCsv = '';
let contents;
let openthistab = false;
const openthese = [];

chrome.runtime.onInstalled.addListener(() => {
// Initialization code here
});

chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
// Handle messages from content scripts or popup
});

// Export any functions that need to be accessed by other parts of the extension
self.dothis = {
try: function(evt) {
return evt.target.files[0];
}
};

14 changes: 7 additions & 7 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "Tab-Snap",
"version": "1.2.9",
"version": "1.3.0",
"description": "Get open tab URLs for window, or load a list of URLs into new tabs on this window.",
"icons": {
"128": "icon128.png",
"48": "icon48.png"
},
"browser_action": {
},
"action": {
"default_icon": "icon128.png",
"default_title": "Tab-Snap",
"default_popup": "popup.html"
},
"options_page": "options.html",
"permissions": [ "tabs" ]
},
"options_page": "options.html",
"permissions": ["tabs"]
}
24 changes: 12 additions & 12 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var emailadd = localStorage["output_emailadd"];

if(favorite1=="clipa"){
window.myCsv='';
chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

tabs.forEach(function(tab){
var temptest=tab.url.split(":");
Expand All @@ -54,7 +54,7 @@ chrome.tabs.query({'currentWindow': true}, function(tabs) {

if(favorite1=="clipb"){
window.myCsv='';
chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

var curDate = new Date();
var currentTime = new Date();
Expand Down Expand Up @@ -113,7 +113,7 @@ chrome.tabs.query({'currentWindow': true}, function(tabs) {

if(favorite1=="text"){
window.myCsv='';
chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

var curDate = new Date();
var currentTime = new Date();
Expand Down Expand Up @@ -204,7 +204,7 @@ chrome.tabs.query({'currentWindow': true}, function(tabs) {

if(favorite1=="gmail"){

chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

var curDate = new Date();
var currentTime = new Date();
Expand Down Expand Up @@ -255,7 +255,7 @@ chrome.tabs.query({'currentWindow': true}, function(tabs) {

if(favorite1=="gmail2"){
window.myCsv='';
chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

var curDate = new Date();
var currentTime = new Date();
Expand Down Expand Up @@ -326,7 +326,7 @@ chrome.tabs.query({'currentWindow': true}, function(tabs) {

if(favorite1=="simple"){
window.myCsv='';
chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

tabs.forEach(function(tab){
var temptest=tab.url.split(":");
Expand Down Expand Up @@ -389,7 +389,7 @@ if(favorite2=="file"){

if(favorite1=="csv1"){

chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {
window.myCsv='';
tabs.forEach(function(tab){

Expand Down Expand Up @@ -453,7 +453,7 @@ if(favorite1=="csv2"){



chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {
window.myCsv='';
var curDate = new Date();
var currentTime = new Date();
Expand Down Expand Up @@ -511,7 +511,7 @@ if(favorite2=="file"){

if(favorite1=="csv3"){

chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

window.myCsv='';
var curDate = new Date();
Expand Down Expand Up @@ -628,7 +628,7 @@ function testResults(){
function testResults(){

window.contents = this.form.inputbox.value;
chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

var lines = window.contents.split(/[\r\n|\n]+/);
var firstr=[];
Expand Down Expand Up @@ -689,7 +689,7 @@ function gogo(){
function testResults(){

window.contents = this.form.inputbox.value;
chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {

var lines = window.contents.split(/[\r\n|\n]+/);
var firstr=[];
Expand Down Expand Up @@ -725,7 +725,7 @@ function testResults(){
}

function handleFileSelect(evt) {
chrome.tabs.query({'currentWindow': true}, function(tabs) {
chrome.tabs.query({'currentWindow': true}).then(function(tabs) {
console.log("here");
var f = evt.target.files[0];
// back.dothis.try(evt);//evt.target.files[0];
Expand Down