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,94 +4,112 @@ 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;
//console.log("area_mode:"+ settings.area_auto_select.mode);
//console.log("area_keyword:"+ settings.area_auto_select.area_keyword);
//console.log("keyword_exclude:"+ settings.keyword_exclude);
let exclude_keyword_array = [];
if(settings.keyword_exclude.length > 0) {
exclude_keyword_array = JSON.parse('[' + settings.keyword_exclude +']');
}
for (let i = 0; i < exclude_keyword_array.length; i++) {
$("ul.area-list > li > a:contains('"+ exclude_keyword_array[i] +"')").each(function ()
{
$(this).parent().remove();
}
);
}
{
let area_keyword_array = [];
if(settings.area_auto_select.area_keyword.length > 0) {
area_keyword_array = JSON.parse('[' + settings.area_auto_select.area_keyword +']');
}
console.log(area_keyword_array);
let target_area;
if(area_keyword_array.length) {
for (let i = 0; i < area_keyword_array.length; i++) {
let query_string = "ul.area-list > li > a:contains('"+ area_keyword_array[i] +"')";
if(area_keyword_array[i]=="") {
query_string = "ul.area-list > li > a"
}
if(settings.tixcraft.area_auto_select.mode=="from top to bottom")
target_area = $(query_string).first();
if(settings.tixcraft.area_auto_select.mode=="from bottom to top")
target_area = $(query_string).last();
if(settings.tixcraft.area_auto_select.mode=="center")
target_area = $(query_string).first();
if(settings.tixcraft.area_auto_select.mode=="random")
target_area = $(query_string).first();
if (target_area.length) {
console.log("match keyword:" + area_keyword_array[i]);
break;
}
}
} else {
target_area = $("ul.area-list > li > a").first();
}
if (target_area.length) {
let link_id = target_area.attr("id");
//console.log("link_id: " + link_id);
if(link_id) {
let body = document.body.innerHTML;
let areaUrlList = null;
if(body.indexOf('var areaUrlList =')>-1) {
const javasrit_right = body.split('var areaUrlList =')[1];
let areaUrlHtml = "";
if(javasrit_right) {
areaUrlHtml = javasrit_right.split("};")[0];
}
if(areaUrlHtml.length > 0) {
areaUrlHtml = areaUrlHtml + "}";
areaUrlList = JSON.parse(areaUrlHtml);
}
//console.log(areaUrlHtml);
}
let new_url = null;
if(areaUrlList) {
let new_url = areaUrlList[link_id];
if (new_url) {
//console.log(new_url);
window.location.href = new_url
}
}
}
} else {
console.log("not target_area found.")
}
}
function tixcraft_area_main(settings) {
if(settings) {
//console.log("area_mode:"+ settings.area_auto_select.mode);
//console.log("area_keyword:"+ settings.area_auto_select.area_keyword);
//console.log("keyword_exclude:"+ settings.keyword_exclude);
let exclude_keyword_array = [];
if(settings.keyword_exclude.length > 0) {
exclude_keyword_array = JSON.parse('[' + settings.keyword_exclude +']');
} }
}); for (let i = 0; i < exclude_keyword_array.length; i++) {
} else { $("ul.area-list > li > a:contains('"+ exclude_keyword_array[i] +"')").each(function ()
location.reload(); {
$(this).parent().remove();
}
);
}
{
let area_keyword_array = [];
if(settings.area_auto_select.area_keyword.length > 0) {
area_keyword_array = JSON.parse('[' + settings.area_auto_select.area_keyword +']');
}
console.log(area_keyword_array);
let target_area;
if(area_keyword_array.length) {
for (let i = 0; i < area_keyword_array.length; i++) {
let query_string = "ul.area-list > li > a:contains('"+ area_keyword_array[i] +"')";
if(area_keyword_array[i]=="") {
query_string = "ul.area-list > li > a"
}
if(settings.tixcraft.area_auto_select.mode=="from top to bottom")
target_area = $(query_string).first();
if(settings.tixcraft.area_auto_select.mode=="from bottom to top")
target_area = $(query_string).last();
if(settings.tixcraft.area_auto_select.mode=="center")
target_area = $(query_string).first();
if(settings.tixcraft.area_auto_select.mode=="random")
target_area = $(query_string).first();
if (target_area.length) {
console.log("match keyword:" + area_keyword_array[i]);
break;
}
}
} else {
target_area = $("ul.area-list > li > a").first();
}
if (target_area.length) {
let link_id = target_area.attr("id");
//console.log("link_id: " + link_id);
if(link_id) {
let body = document.body.innerHTML;
let areaUrlList = null;
if(body.indexOf('var areaUrlList =')>-1) {
const javasrit_right = body.split('var areaUrlList =')[1];
let areaUrlHtml = "";
if(javasrit_right) {
areaUrlHtml = javasrit_right.split("};")[0];
}
if(areaUrlHtml.length > 0) {
areaUrlHtml = areaUrlHtml + "}";
areaUrlList = JSON.parse(areaUrlHtml);
}
//console.log(areaUrlHtml);
}
let new_url = null;
if(areaUrlList) {
let new_url = areaUrlList[link_id];
if (new_url) {
//console.log(new_url);
window.location.href = new_url
}
}
}
} else {
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 {
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,64 +23,89 @@ if ($("#gameList button").length) {
} }
); );
} }
if ($("#gameList button").length) { }
storage.get('settings', function (items)
{
if (items.settings)
{
settings = items.settings;
myInterval = setInterval(() => {
//console.log("date_mode:"+ settings.tixcraft.date_auto_select.mode);
//console.log("date_keyword:"+ settings.tixcraft.date_auto_select.date_keyword);
let date_keyword_array = [];
if(settings.tixcraft.date_auto_select.date_keyword.length > 0) {
date_keyword_array = JSON.parse('[' + settings.tixcraft.date_auto_select.date_keyword +']');
}
//console.log(date_keyword_array);
let target_date;
if(date_keyword_array.length) {
for (let i = 0; i < date_keyword_array.length; i++) {
let query_string = "#gameList td:contains('"+ date_keyword_array[i] +"')";
if(date_keyword_array[i]=="") {
query_string = "#gameList td"
}
if(settings.tixcraft.date_auto_select.mode=="from top to bottom")
target_date = $(query_string).first();
if(settings.tixcraft.date_auto_select.mode=="from bottom to top")
target_date = $(query_string).last();
if(settings.tixcraft.date_auto_select.mode=="center")
target_date = $(query_string).first();
if(settings.tixcraft.date_auto_select.mode=="random")
target_date = $(query_string).first();
if (target_date.length) { function date_main(settings)
//console.log("match keyword:" + date_keyword_array[i]); {
break; myInterval = setInterval(() => {
} //console.log("date_mode:"+ settings.tixcraft.date_auto_select.mode);
} //console.log("date_keyword:"+ settings.tixcraft.date_auto_select.date_keyword);
} else { let date_keyword_array = [];
target_date = $("#gameList td").first(); if(settings.tixcraft.date_auto_select.date_keyword.length > 0) {
} date_keyword_array = JSON.parse('[' + settings.tixcraft.date_auto_select.date_keyword +']');
}
//console.log(date_keyword_array);
let target_date;
if(date_keyword_array.length) {
for (let i = 0; i < date_keyword_array.length; i++) {
let query_string = "#gameList td:contains('"+ date_keyword_array[i] +"')";
if(date_keyword_array[i]=="") {
query_string = "#gameList td"
}
if(settings.tixcraft.date_auto_select.mode=="from top to bottom")
target_date = $(query_string).first();
if(settings.tixcraft.date_auto_select.mode=="from bottom to top")
target_date = $(query_string).last();
if(settings.tixcraft.date_auto_select.mode=="center")
target_date = $(query_string).first();
if(settings.tixcraft.date_auto_select.mode=="random")
target_date = $(query_string).first();
if (target_date.length) { if (target_date.length) {
let link = target_date.parent().find("button").attr("data-href"); //console.log("match keyword:" + date_keyword_array[i]);
if (link) { break;
//console.log("link: " + link); }
clearInterval(myInterval);
window.location.href = link;
}
} else {
//console.log("not target_date found.")
}
}, 200);
} else {
console.log('no settings found');
} }
}); } else {
target_date = $("#gameList td").first();
}
if (target_date.length) {
let link = target_date.parent().find("button").attr("data-href");
if (link) {
//console.log("link: " + link);
clearInterval(myInterval);
window.location.href = link;
}
} else {
//console.log("not target_date found.")
}
}, 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 {
console.log('no settings found');
}
});
} else {
location.reload();
}
} else { } else {
location.reload(); location.reload();
} }
} else {
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;
{ //console.log("ticket_number:"+ settings.ticket_number);
settings = items.settings; assign_ticket_number(settings.ticket_number);
console.log("ticket_number:"+ settings.ticket_number); } else {
assign_ticket_number(settings.ticket_number); console.log('no settings found');
} else { }
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"]
}
} }
] ]