Created
December 29, 2020 10:01
-
-
Save IchSchreiGleich/20e7b9985ea5a8ef42dc4e52b57cc265 to your computer and use it in GitHub Desktop.
Removes unnecessarily page elemets like navigations, searchbars, eg from the orderlist so its printing optimized. Additionally the thumbnail product images are replaces by its fullsized originals.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name AliExpress: Printable Orderlist | |
| // @namespace isg | |
| // @version 1.0 | |
| // @description Removes unnecessarily page elemets like navigations, searchbars, eg from the orderlist so its printing optimized. Additionally the thumbnail product images are replaces by its fullsized originals. | |
| // @author IchSchreiGleich | |
| // @match https://trade.aliexpress.com/orderList.htm* | |
| // @grant GM_registerMenuCommand | |
| // @grant GM_addStyle | |
| // @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| // Insert menu entry | |
| GM_registerMenuCommand("Show Printable Version", function(){ | |
| // Removing unnecessarily page elemets | |
| $("#header, #top-lighthouse, .navigation, .col-xs-12, #simple-pager, div.grid-col-container:nth-child(2), div.grid-col-container:nth-child(3), div.grid-col-container:nth-child(5), .site-footer, .footer-copywrite, #J_xiaomi_dialog").remove(); | |
| // Overriding some styles | |
| GM_addStyle(".col-xs-48 { width: 100%; !important}"); | |
| GM_addStyle("#buyer-ordertable col.selector { width: 100px !important; }"); | |
| GM_addStyle("div.product-left { width: 150px !important; }"); | |
| GM_addStyle("div.product-left img { width: 130px !important; }"); | |
| // Enlarging product images | |
| $("img[src*='ae01.alicdn.com'").each(function(){ | |
| $(this).attr("src", $(this).attr("src").split("_")[0]); | |
| }); | |
| }); | |
| // Add some "orders per page" entries | |
| $("#simple-pager-page-size").append(new Option("100/Page", "100")); | |
| $("#simple-pager-page-size").append(new Option("1/Page", "1")); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment