add new features

master
unknown 2024-01-03 19:36:26 +08:00
parent 04bf9893ee
commit a11441e3e9
12 changed files with 26703 additions and 170 deletions

View File

@ -1,5 +1,11 @@
/*
* extension process crashes or your extension is manually stopped at
* chrome://serviceworker-internals
*/
'use strict'; 'use strict';
const storage = chrome.storage.local;
chrome.declarativeNetRequest.onRuleMatchedDebug.addListener((e) => { chrome.declarativeNetRequest.onRuleMatchedDebug.addListener((e) => {
const msg = `Navigation blocked to ${e.request.url} on tab ${e.request.tabId}.`; const msg = `Navigation blocked to ${e.request.url} on tab ${e.request.tabId}.`;
//console.log(msg); //console.log(msg);
@ -17,4 +23,23 @@ chrome.runtime.onInstalled.addListener(function(){
); );
} }
); );
let default_status='ON';
chrome.action.setBadgeText({
text: default_status
});
storage.set({status: default_status});
});
chrome.action.onClicked.addListener(async (tab) => {
const prevState = await chrome.action.getBadgeText({ tabId: tab.id });
// Next state will always be the opposite
const nextState = prevState === 'ON' ? 'OFF' : 'ON';
storage.set({status: nextState});
// Set the action badge to the next state
await chrome.action.setBadgeText({
tabId: tab.id,
text: nextState
});
}); });

View File

@ -1 +1 @@
{"homepage": "https://kktix.com", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "ticket_number": 2, "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true}, "tixcraft": {"date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "area_auto_select": {"enable": true, "mode": "random", "area_keyword": ""}, "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "advanced": {"play_captcha_sound": {"enable": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "weng.32002@gmail.com", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "eXlme2omX3Nq", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "adblock_plus_enable": false, "disable_adjacent_seat": false, "hide_some_image": true, "block_facebook_network": false, "headless": false, "verbose": true, "auto_guess_options": true, "user_guess_string": "", "online_dictionary_url": "", "auto_reload_page_interval": 1.0, "auto_reload_random_delay": false, "proxy_server_port": ""}} {"homepage": "https://tixcraft.com", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "ticket_number": 2, "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true}, "tixcraft": {"date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "area_auto_select": {"enable": true, "mode": "random", "area_keyword": ""}, "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "advanced": {"play_captcha_sound": {"enable": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "adblock_plus_enable": false, "disable_adjacent_seat": false, "hide_some_image": true, "block_facebook_network": false, "headless": false, "verbose": true, "auto_guess_options": true, "user_guess_string": "", "online_dictionary_url": "", "auto_reload_page_interval": 1.0, "auto_reload_random_delay": false, "proxy_server_port": ""}}

View File

@ -1,3 +1,4 @@
const storage = chrome.storage.local;
var eventDataCache = null; var eventDataCache = null;
var performanceDataCache = null; var performanceDataCache = null;
var selectedPerfId = null; var selectedPerfId = null;
@ -296,14 +297,23 @@ var loadData = function() {
} }
} }
function cityline_event_status_check()
console.log("start my extension"); {
selectedPerfId = getUrlParameter('perfId');
selectedPerfId = getUrlParameter('perfId'); if(pageLoaded) {
if(pageLoaded) {
reloadFromCache(); reloadFromCache();
}else{ }else{
pageLoaded = true; pageLoaded = true;
loadData(); loadData();
}
} }
storage.get('status', function (items)
{
if (items.status && items.status=='ON')
{
cityline_event_status_check();
} else {
console.log('no status found');
}
});

View File

@ -0,0 +1,32 @@
const storage = chrome.storage.local;
$("div.description").remove();
$("footer").remove();
function kktix_event_redirect()
{
const currentUrl = window.location.href;
const event_code = currentUrl.split('/')[4];
//console.log(currentUrl);
//console.log(event_code);
if(event_code){
let button_count = $("div.tickets > a.btn-point").length;
console.log("length:"+button_count);
if (button_count == 1) {
let new_url = "https://kktix.com/events/"+ event_code +"/registrations/new";
location.href=new_url;
} else {
// do nothing.
}
}
}
storage.get('status', function (items)
{
if (items.status && items.status=='ON')
{
kktix_event_redirect();
} else {
console.log('no status found');
}
});

View File

@ -1,11 +1,15 @@
const storage = chrome.storage.local;
$("footer").remove(); $("footer").remove();
setTimeout(function () { setTimeout(function () {
$("div.banner-wrapper").remove(); $("div.banner-wrapper").remove();
$("div.ticket-img-wrapper").remove(); $("div.ticket-img-wrapper").remove();
}, 300); }, 300);
(function () { function kktix_event_status_check()
{
const currentUrl = window.location.href; const currentUrl = window.location.href;
const event_code = currentUrl.split('/')[4]; const event_code = currentUrl.split('/')[4];
//console.log(currentUrl); //console.log(currentUrl);
@ -33,4 +37,16 @@ setTimeout(function () {
//alert( "finished" ); //alert( "finished" );
}); });
} }
})(); }
storage.get('status', function (items)
{
if (items.status && items.status=='ON')
{
kktix_event_status_check();
} else {
console.log('no status found');
}
});

View File

@ -0,0 +1,10 @@
'use strict';
import { decrypt } from "./vendor/crypto";
console.log('hello');
setTimeout(function () {
$("#banner").remove();
$("footer").remove();
$("#activityInfo").remove();
}, 400);

View File

@ -4,13 +4,9 @@ var settings = null;
$("ul.area-list > li:not(:has(a))").remove(); $("ul.area-list > li:not(:has(a))").remove();
$("#selectseat div div img").remove(); $("#selectseat div div img").remove();
$("footer").remove(); $("footer").remove();
if ($("ul.area-list > li:has(a)").length) {
storage.get('settings', function (items)
{
if (items.settings)
{
settings = items.settings;
function tixcraft_area_main(settings) {
if(settings) {
//console.log("area_mode:"+ settings.area_auto_select.mode); //console.log("area_mode:"+ settings.area_auto_select.mode);
//console.log("area_keyword:"+ settings.area_auto_select.area_keyword); //console.log("area_keyword:"+ settings.area_auto_select.area_keyword);
//console.log("keyword_exclude:"+ settings.keyword_exclude); //console.log("keyword_exclude:"+ settings.keyword_exclude);
@ -89,9 +85,31 @@ if ($("ul.area-list > li:has(a)").length) {
console.log("not target_area found.") console.log("not target_area found.")
} }
} }
}
}
function area_auto_reload()
{
if ($("ul.area-list > li:has(a)").length) {
storage.get('settings', function (items)
{
if (items.settings)
{
settings = items.settings;
tixcraft_area_main(settings);
} }
}); });
} else { } else {
location.reload(); location.reload();
}
} }
storage.get('status', function (items)
{
if (items.status && items.status=='ON')
{
area_auto_reload();
} else {
console.log('no status found');
}
});

View File

@ -3,7 +3,9 @@ var settings = null;
var myInterval = null; var myInterval = null;
$("div.masthead-wrap").remove(); $("div.masthead-wrap").remove();
if ($("#gameList button").length) {
function date_clean()
{
remove_list=['Currently Unavailable', remove_list=['Currently Unavailable',
'Sale ended on 20', 'Sale ended on 20',
'Sold out', 'Sold out',
@ -21,12 +23,10 @@ if ($("#gameList button").length) {
} }
); );
} }
if ($("#gameList button").length) { }
storage.get('settings', function (items)
{ function date_main(settings)
if (items.settings) {
{
settings = items.settings;
myInterval = setInterval(() => { myInterval = setInterval(() => {
//console.log("date_mode:"+ settings.tixcraft.date_auto_select.mode); //console.log("date_mode:"+ settings.tixcraft.date_auto_select.mode);
//console.log("date_keyword:"+ settings.tixcraft.date_auto_select.date_keyword); //console.log("date_keyword:"+ settings.tixcraft.date_auto_select.date_keyword);
@ -71,6 +71,19 @@ if ($("#gameList button").length) {
//console.log("not target_date found.") //console.log("not target_date found.")
} }
}, 200); }, 200);
}
function date_auto_reload()
{
if ($("#gameList button").length) {
date_clean();
if ($("#gameList button").length) {
storage.get('settings', function (items)
{
if (items.settings)
{
settings = items.settings;
date_main(settings);
} else { } else {
console.log('no settings found'); console.log('no settings found');
} }
@ -79,6 +92,20 @@ if ($("#gameList button").length) {
} else { } else {
location.reload(); location.reload();
} }
} else { } else {
location.reload(); location.reload();
}
} }
storage.get('status', function (items)
{
console.log(items);
if (items.status && items.status=='ON')
{
date_auto_reload();
} else {
console.log('no status found');
}
});

View File

@ -38,16 +38,14 @@ function assign_ticket_number(ticket_number)
} }
} }
(function () { storage.get('settings', function (items)
storage.get('settings', function (items) {
{
if (items.settings) if (items.settings)
{ {
settings = items.settings; settings = items.settings;
console.log("ticket_number:"+ settings.ticket_number); //console.log("ticket_number:"+ settings.ticket_number);
assign_ticket_number(settings.ticket_number); assign_ticket_number(settings.ticket_number);
} else { } else {
console.log('no settings found'); console.log('no settings found');
} }
}); });
})();

26362
webdriver/Maxbot_1.0.0/js/vendor/crypto.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -86,10 +86,27 @@
"js" : [ "jquery.min.js", "js/ibon_area.js" ] "js" : [ "jquery.min.js", "js/ibon_area.js" ]
}, },
{ {
"matches" : [ "https://*.cityline.com/utsvInternet/internet/eventDetail?event=*" ], "matches" : [
"https://*.cityline.com/utsvInternet/internet/eventDetail?event=*",
"https://*.cityline.com/utsvlnternet/*/login?lang=TW"
],
"run_at": "document_end", "run_at": "document_end",
"js" : [ "jquery.min.js", "js/cityline_event_common.js","js/cityline_event_detail.js" ] "js" : [ "jquery.min.js", "js/cityline_event_common.js","js/cityline_event_detail.js" ]
}, },
{
"matches" : [
"https://ticketplus.com.tw/activity/*"
],
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/ticketplus_activity.js", "/js/vendor/crypto.js" ]
},
{
"matches" : [
"https://*.kktix.cc/events/*"
],
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/kktix_events.js" ]
},
{ {
"matches" : [ "matches" : [
"https://kktix.com/events/*/registrations/new" "https://kktix.com/events/*/registrations/new"

View File

@ -241,5 +241,23 @@
"urlFilter": "*ubas.setn.com/*", "urlFilter": "*ubas.setn.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"] "resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
} }
},
{
"id": 28,
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*play.google.com/log?*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
}
},
{
"id": 29,
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*www.youtube.com/youtubei/v1/player/heartbeat*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
}
} }
] ]