DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA Drop Zone javascript link extractor and launcher  (Read 13,336 times)

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
IDEA Drop Zone javascript link extractor and launcher
« on: March 23, 2021, 09:51 PM »
Preferably in AHK so I can learn a little

I use Ancestry...

  In the past it would provide a search result list with links. You could right click the ones of interest into a new tab, or window. They have recently moved to javascript. which only allows you to open one choice in the current window. a right pain as it slows down everything you do !

First  a drop zone is needed where I can drag the javascript link.

On mouseover the status bars shows. 
Code
javascript:SetCfpId(102049804500)

The variable we need is the bit between the brackets. In this example.
Code
102049804500

The util will need a place for the user to store the "URL string" the javascript variable gets appended to.

example of "URL string"
Code
https://www.ancestry.co.uk/family-tree/tree/12345678/family/familyview?cfpid=
On dropping the link, the real URL is assembled
eg
Code
https://www.ancestry.co.uk/family-tree/tree/12345678/family/familyview?cfpid=102049804500

The resulting URL should ideally be launched in a new tab on the source browser window, or a new window.

Using Chrome.

TIA
John
Why an I Magician62? Because Magician1 thru 61 were gone. :)

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #1 on: March 23, 2021, 10:05 PM »
I would think a UserScript would be a better option, have the links replaced directly in the page.

BTW, just tried a search on Ancestry and it comes back with full links here, (wife uses Ancestry all the time via the local library portal).
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: March 23, 2021, 11:28 PM by 4wd »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #2 on: March 24, 2021, 10:06 AM »
The links I refer to are those provided when in "tree view" and you do a "tree search".

[attach=#]
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #3 on: March 24, 2021, 10:16 AM »
The resulting URL should ideally be launched in a new tab on the source browser window, or a new window.

Using Chrome.

TIA
John

Hi John, sure thing! Give me a day or two to complete this "Drop Launcher" project  :Thmbsup:

Cheers!
Vic
« Last Edit: April 11, 2021, 07:47 PM by publicdomain »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #4 on: March 24, 2021, 10:53 AM »
Many thanks for the reply Vic.

I am noticing more and more each day, websites making things "harder"/"slower". I wonder how much is to make it mobile compatible. Not that anyone would have several screens open at the same time on multiple monitors. :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #5 on: March 25, 2021, 11:39 PM »
Many thanks for the reply Vic.

My pleasure! :)

Quick question before uploading first alpha as per your requirements. Is this Chrome-only?
« Last Edit: March 25, 2021, 11:45 PM by publicdomain »

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #6 on: March 30, 2021, 07:05 AM »
Sorry for the slow reply, days have just disappeared of late.

Yes, Chrome only. I rarely use Firefox, never Edge. and only use IE if nothing else works. :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #7 on: April 08, 2021, 03:39 AM »
Yes, Chrome only.

Hello John! This alpha release should do exactly what you want for the ancestry site :)

DropLauncher_v0-1-0.png

Please download & test (Updated to v0.1.0): https://github.com/publicdomain/drop-launcher/releases/tag/v0.1.0

Cheers!
Vic
« Last Edit: April 11, 2021, 08:50 PM by publicdomain »

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #8 on: April 09, 2021, 10:38 PM »
(A more-generic version is in the making with regular expressions for adapting it to any site)

It's published! :)

Drop Launcher thread: https://www.donationcoder.com/forum/index.php?topic=51294.0

Cheers!
Vic

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #9 on: April 11, 2021, 09:49 AM »
Sorry I have been absent for a few days, though it seems like years. :) Will take a look later when I return. :) I hadn't realised how long it has been since I last checked my emails!
Why an I Magician62? Because Magician1 thru 61 were gone. :)

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #10 on: April 11, 2021, 03:44 PM »
I think I am am going to have to try again in the morning. I downloaded, but nothing appeared to happen. I edited the tree URL. It indicated it had launched after a drop, but nothing seen.

I also found another ancestry Feature. If you use the tree search from a persons profile, it still provides a real link. It's great they code for consistency, NOT! :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #11 on: April 11, 2021, 08:37 PM »
I think I am am going to have to try again in the morning. I downloaded, but nothing appeared to happen.

Please try with latest version (v0.1.0) at: https://github.com/publicdomain/drop-launcher/releases/tag/v0.1.0

Thanks!

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #12 on: April 11, 2021, 09:20 PM »

Please try with latest version (v0.1.0) at: https://github.com/publicdomain/drop-launcher/releases/tag/v0.1.0

Thanks!


No noticeable difference. Still counts number launched, but nothing appears.

Is there a way to tweak it so it just outputs what I have dragged and what it is proposing to do?

I did try editing the settings to make LaunchRegex the same as resulting page, the theory was no matter what was dropped it would execute a valid result. That didn't do anything either, but then I was guessing. :)
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #13 on: April 11, 2021, 11:52 PM »
No noticeable difference. Still counts number launched, but nothing appears.

Is there a way to tweak it so it just outputs what I have dragged and what it is proposing to do?

There may be no need for such a "debug tweak" :)

Please retry with this fixed version (v0.1.1): https://github.com/publicdomain/drop-launcher/releases/tag/v0.1.1

Many thanks for your test & report :-*

User input is magical! It makes software work as it should  :Thmbsup:

Cheers!
Vic

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #14 on: April 12, 2021, 04:44 PM »
Please retry with this fixed version (v0.1.1): https://github.com/publicdomain/drop-launcher/releases/tag/v0.1.1

Tested on Windows 10 using Google Chrome. Matches regex & launches.

https://github.com/publicdomain/drop-launcher/releases/tag/v0.1.1

magician62

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 180
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #15 on: April 13, 2021, 06:29 PM »
It works It works. Many thanks indeed.
Why an I Magician62? Because Magician1 thru 61 were gone. :)

publicdomain

  • Honorary Member
  • Joined in 2019
  • **
  • Posts: 732
    • Participated in NANY Challenge Three Times
    • Linux User
Re: IDEA Drop Zone javascript link extractor and launcher
« Reply #16 on: April 14, 2021, 03:00 AM »
It works It works. Many thanks indeed.

So glad you liked it :)

Preferably in AHK so I can learn a little

You may learn the Regular Expression language for .NET to expand the program's matching & launching: https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference

Cheers & I'm very happy to assist :Thmbsup:

Vic

Original address: https://www.donationcoder.com/forum/index.php?topic=51227.0