Skip to content

Instantly share code, notes, and snippets.

@LeonFedotov
Last active May 2, 2019 08:36
Show Gist options
  • Save LeonFedotov/1d9bf7a30f0a0ad0b1c755b5bfd0b7dc to your computer and use it in GitHub Desktop.
Save LeonFedotov/1d9bf7a30f0a0ad0b1c755b5bfd0b7dc to your computer and use it in GitHub Desktop.
Bookmarklet: Print to pdf ali express order page with all the info shown and filename set to "order id - price"
// The way I used it is to open all my orders one by one from the order page
// and then start clicking on this bookmarklet starting from the first order tab
// the bookmarklet changes the title and shows the finance tab
// then launches the print dialog and closes the tab.
javascript:(function () {
document.title = `${window.location.search.split('=').pop()} - ${document.getElementsByClassName('final-price').item(2).innerText}`;
document.getElementById('fund-pnl').style.display = 'block';
document.getElementById('operate-pnl').style.display = 'block';
window.print();
window.close()
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment