Q: Is it possible to write a command in that script which automatically saves the original address as a bookmark, in that folder, before redirecting me? I can't find such a command.
Background:
Pretty much new to programming. I'm a student with a broken arm. When I come across an interesting article behind a paywall, I just reload the page using the university's proxy. With one arm broken, I have to do everything with the other hand. So I wrote a javascript in tampermonkey (similar to greasemonkey) which rewrites the URL and loads that page.
To keep track of the articles I've read, I add the address to my bookmarks, in a folder called "Already Read".
Code so far: (No bookmark command yet.)
// ==UserScript==
// @name Cat.
// @include https://www.sciencedirect.com/science/article/*
// @grant GM_setClipboard
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// ==/UserScript==
(function() {
'use strict';
var OldURL = location.href;
//Saves current URL into a string, "OldURL"
location.href = OldURL.replace('https://www','http://proxy.ub.umu.se/login?url=https://www');
//replaces the ScienceDirect domain, replaces it with the university proxy, and loads that address.
Desired result: add current page to my bookmarks automatically.
Preferably in a given bookmark folder, but I'd be very grateful to just add the bookmark anywhere. (Having a broken arm is not fun, studying is my catharsis for dealing with the boredom, so I really need to get this.) ANY help would be greatly appreciated!
What I've tried:
I've tried most bookmark related JavaScript commands I could find. (That's how I figured out the rest of TamperMonkey's functions.) But none seem to work. I've also tried including the commands to allow TamperMonkey to run a script without safety restrictions, such as // @grant GM_deleteValue etc.