Dynamic hyperlinks
Page 1 of 1
Karmeck




Posts: 3350
Location: Sweden
PostPosted: Fri, 26th May 2017 12:41    Post subject: Dynamic hyperlinks
Can a link be crated that takes you to a difrent address depending on the address you are visiting from.

We have a work site that you can visit using a portal or directly if your connected to the work network. Now the problem is I'm visiting using the portal but the link I'm given is made for use by people who are connected to the network. I can get to the page using the portal if I navigated there my self but having the link be dynamic would remove that headache.

Can this be done?
Back to top
Wubbajack




Posts: 769
Location: Polandball's right eye
PostPosted: Fri, 26th May 2017 13:48    Post subject:
Sure it can, depends on how much access you have to the backend of the site you want to place that link on. Heck, it's probabaly even doable in pure JS ( Vomit ), but you'll still need access to the site's source code.
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Fri, 26th May 2017 14:32    Post subject:
If it's just for you, write your own greasemonkey/tampermonkey script to overwrite the link target. Will not require any changes on the server and works for anybody with your script.

Tampermonkey example:

Code:

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://www.myworkpage.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    document.querySelector("#inmywhat").href="http://www.inyourbutt.com";
})();


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - The Useless Void
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group