A saved link whose web address is retrieved from the webpage

Have you come across a website where the URL of a specific button changes weekly? Are you looking for a solution to create a bookmark that will redirect you to this changing URL?

You may have tried using a Bookmarklet, but encountered issues as the JavaScript code needs the page to load completely when executed.

Below is an example of what you may have attempted:

javascript:(function(){
    window.location.href = "https://rasp.tpu.ru/site/department.html?id=7950&cource=1";
    window.location.href = Array.from(document.querySelectorAll('a')).find(element => element.href.includes('gruppa_42148')).href 
})();

If waiting for the website to load didn't solve the problem, such as in the script below:

javascript:(function(){
    window.location.href = "https://rasp.tpu.ru/site/department.html?id=7950&cource=1";
    window.addEventListener('load', function () { window.location.href = Array.from(document.querySelectorAll('a')).find(element => element.href.includes('gruppa_42148')).href })
})();

You may be facing limitations with bookmarklets in accessing content from one page to another for continuation of the script.

Alternatively, consider exploring options like writing a script in Tampermonkey that triggers only when visiting the site from a specific bookmark. However, the implementation may require further research and experimentation.

Answer №1

Discover a hidden link on this particular page that leads to the calendar section through a series of server redirects:

> >


Customize your browsing experience using tampermonkey:

// ==UserScript==
// @name         bookmark
// @namespace    http://tampermonkey.net/
// @version      2024-09-04
// @description  .
// @author       You
// @match        https://rasp.tpu.ru/site/department.html?id=7950&cource=1
// @icon         https://www.google.com/s2/favicons?sz=64&domain=tpu.ru
// @grant        none
// ==/UserScript==


if (location.hash === '#bookmark'){
    const a = document.querySelector('a[href*=gruppa_42148]');
    a && location.replace(a.href);
}

This script will redirect only when the URL contains the hash #bookmark.

Create a bookmark with this custom URL:

https://rasp.tpu.ru/site/department.html?id=7950&cource=1#bookmark

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

unselect the button using jQuery

I want to trigger a popover when a variable exceeds a certain value, triggered by clicking a button: $(function () { $('[data-toggle="tooltip"]').tooltip({ trigger: 'manual', placement: 'top', titl ...

Best practices for showing the SVG element stored in a variable

Encountering an issue with displaying an SVG element stored within a JavaScript variable. The unique situation demands that the SVG is retrieved from the backend as a string value. Upon receiving the response, the SVG data is stored like so: let svgValue ...

Encountering XMLHttpRequest errors when trying to make an AJAX POST request

I'm encountering an issue with a modal containing a form for submitting emails. Despite setting up the ajax post as usual, the submission is failing consistently. The console displays the following two errors: Setting XMLHttpRequest.withCredent ...

Error in Vue Google Maps: Marker not defined

I'm currently working on integrating a single location map using Google Maps in Vue 2 with Vue-google-maps-2. Despite using code that has successfully worked for other parts of the application where multiple markers are plotted from an array, I am enc ...

Is there a way to adjust the contrast of an image using an HTML slider and JavaScript without utilizing the canvas element?

Looking to develop a slider with HTML and JavaScript (or jQuery, CSV,...) that can adjust the contrast of an image, similar to this topic. However, I would prefer not to utilize Canvas in HTML5 for this project. Any suggestions on how to achieve this with ...

The Node.js application successfully receives an emit event from the browser, however, the browser does not receive any emit

I'm having trouble understanding why the node.js server can connect and receive an emit() from the browser, but when I try to emit() back from node.js it doesn't reach the browser. Am I overlooking something here? The console log displays "Test ...

What is the best way to consistently and frequently invoke a REST API in Angular 8 using RxJS?

I have developed a REST API that retrieves a list of values. My goal is to immediately invoke this API to fetch values and store them in a component's member variable. Subsequently, I plan to refresh the data every five minutes. Upon conducting some ...

Issue with displaying full screen Google map within a large modal in Bootstrap 4

I successfully integrated a Google map into a large modal using Bootstrap 4. However, I encountered an issue where the map would not display when clicking the fullscreen button within the modal. I am struggling to find a solution for this problem. How can ...

Determine the Javascript code needed to identify the button change that was implemented

As a beginner in the world of Javascript, I've been experimenting with incorporating Javascript into my ASP.NET MVC project. Within my project, I have multiple buttons that toggle between different states, such as from ON to OFF. Each button correspo ...

The identical page content is displayed on each and every URL

Implementing a multi-step form in Next JS involves adding specific code within the app.js file. Here is an example of how it can be done: import React from "react"; import ReactDOM from "react-dom"; // Other necessary imports... // Add ...

Limit DerbyJS to re-rendering specific DOM elements

Currently, DerbyJS (visit http://derbyjs.com) functions by replacing everything in the body tag of the document each time a link is clicked. Is there a way to utilize the template, but replace only the content inside #main-content instead of refreshing th ...

Determining a quaternion through the combination of two angles

I am currently working on a script that allows the THREE.js camera to rotate based on input from a mobile phone's gyroscope. While the functionality is mostly working fine, I have noticed an issue where the camera abruptly turns 180 degrees when cross ...

How to avoid an additional carriage return in Internet Explorer when editing a Textarea?

In Internet Explorer, we are facing an issue with a multiline textarea. After setting the content using JavaScript and checking it, everything appears correct without any additional carriage returns in the textarea: document.getElementById( 'text-ar ...

Implementing Vuejs sorting feature post rendering

Currently, I have elements linked to @click event listeners. <th @click="sort('dateadded')" class="created_at">Date Added I am looking for a way to automatically trigger this sorting function when the Vue.js component renders, so that th ...

transform json array into a consolidated array by merging identical IDs

I need to transform an array into a different format based on the values of the ID and class properties. Here is the initial array: const json = [{ "ID": 10, "Sum": 860, "class": "K", }, { "ID": 10, "Sum": 760, "class": "one", }, { "ID": ...

When using Angular, it is important to remember that calling `this.useraccount.next(user)` may result in an error stating that an argument of type 'HttpResponse<any>' cannot be used with a 'Useraccount' balance

When attempting to use this.useraccountsubject(user) to insert information upon login, I encountered an error: ErrorType: this.useraccount.next(user) then Error An argument of type 'HttpResponse' is not allowed against a balance of 'Userac ...

The OnClientClick function fails to execute

I've been attempting to validate the contactno control using a JavaScript function, but it doesn't seem to be triggered before the OnClick event. This is the JavaScript code I'm using: <script type="text/javascript"> function valida ...

Transferring data through asynchronous JavaScript and XML streaming

Is there a way to access AJAX data before the request is complete in order to achieve streaming, similar to the example below: ajax_request.send(); interval = setInterval(function() { continueParsing(ajax_request.responseText); if (download_comple ...

Utilizing an asynchronous function in ES6 Vue.js and TypeScript

I'm currently working on optimizing my code for reusability, and I've decided to store multiple async functions in a separate file. blog.ts import db from '@/firebase/init' async function fetchTags (uid) { const tags = db.collecti ...

react-router: How can a <Link> be disabled when it is already active?

Is there a way to disable a <Link> element in react-router if its URL is already active? For example, if the URL does not change when clicking on <Link>, I want to prevent any further clicks or replace the <Link> with a <span>. The ...