2024-01-18 17:35:42 +00:00
|
|
|
const storage = chrome.storage.local;
|
|
|
|
|
|
|
|
$("div.description").remove();
|
|
|
|
$("footer").remove();
|
|
|
|
|
|
|
|
function kktix_event_redirect()
|
|
|
|
{
|
|
|
|
const currentUrl = window.location.href;
|
2024-01-26 08:53:49 +00:00
|
|
|
let event_code = currentUrl.split('/')[4];
|
|
|
|
if(event_code.indexOf('?') > -1) {
|
|
|
|
event_code = event_code.split('?')[0];
|
|
|
|
}
|
2024-01-18 17:35:42 +00:00
|
|
|
//console.log(currentUrl);
|
|
|
|
//console.log(event_code);
|
|
|
|
if(event_code){
|
|
|
|
let button_count = $("div.tickets > a.btn-point").length;
|
2024-01-26 08:53:49 +00:00
|
|
|
//console.log("length:"+button_count);
|
2024-01-18 17:35:42 +00:00
|
|
|
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');
|
|
|
|
}
|
|
|
|
});
|