0
0

More than 1 year has passed since last update.

slide share広告回避

Last updated at Posted at 2023-07-15

以下でjsを実行
https://chrome.google.com/webstore/detail/scriptautorunner/gpgjofmpmjjopcogjgdldidobhmjmdbm?hl=ja

  • page inclement
    URL: image.slidesharecdn.com

document.onkeydown = function(e) {
    const remove_regex = /\?cb=[0-9]+/i;
    const url = location.href.replace(remove_regex, '');
    
    const regex = /(.+-)([0-9]+)(-[0-9]+\.jpg)$/i;
    const page_num = Number(url.replace(regex, '$2'));
    const pre_url = url.replace(regex, '$1');
    const suf_url = url.replace(regex, '$3');

    switch (e.keyCode) {
        case 37:
            if(page_num > 1) {
                const next_page_num = page_num - 1;
                window.location.href = pre_url + next_page_num + suf_url;
            }

            break;
        case 39:
            const next_page_num = page_num + 1;
            window.location.href = pre_url + next_page_num + suf_url;
            break;

    }


};



  • page を開く
    URL: slideshare.net
document.onkeydown = function(e) {
    const txt = document.documentElement.innerHTML;
    const regex = /https:\/\/image\.slidesharecdn\.com\/[^ ]+\/[^ ]*[0-9]*-1-[456789][0-9]+\.jpg\?cb=[0-9]+/i;
    const url = txt.match(regex);
    switch (e.keyCode) {
        case 13:
            if(url.length > 0)
            {
                window.open(url[0], '_blank');
            }
        
            break;
    }
};
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0