Window Title Changer

window title changer for autoloop and csa

目前為 2018-11-05 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Window Title Changer
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  window title changer for autoloop and csa
// @author       [email protected]
// @include      *autoloop.us*
// @grant        none
// @icon
// ==/UserScript==
'use strict';

//¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
//Window Title Changer
//¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
//autoloop
//works, but is changing the title to the link for some reason
if (window.location.href.includes('autoloop.us/DMS/App/')) {
    document.title = (document.title).split('-')[1];
}

//csa store + product
if (window.location.href.includes('csa.autoloop.us/CustomerProduct/')) {
    var store = ($('#page_canvas > h1 > a:nth-child(2)').text()); //$('#page_canvas > h1 > a:nth-child(2)').text();
    var product = ($('#page_canvas > h1').text());
    product = product.split(':');
    document.title = product[1] + ' - ' + store;

    //csa main store page
} else if (window.location.href.includes('csa.autoloop.us/Customer/')) {
    var storee = ($('#page_canvas > h1').text());
    storee = storee.split('(');
    document.title = storee[0];
}