Copy-BP button fails randomly, and ever more often

Discussions related to the forums itself. Call for moderators. Trash Posts area.
Post Reply
quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Copy-BP button fails randomly, and ever more often

Post by quyxkh »

I've tried in Firefox and Chrome Beta and Chromium, I can hit the "copy to clipboard" button on for instance GitHub and the repo url gets copied to the clipboard, but hitting the sweet blue BP button on this forum now does nothing. So it looks to me like there's something about copying to the clipboard that GitHub knows that phpbb doesn't.

edited title to incorporate comments from eradicator and davemcw: it's not os specific at all, modern web engines are exposing a race in the button setup code more and more often.
Last edited by quyxkh on Fri May 07, 2021 12:26 pm, edited 1 time in total.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Copy-BP button does not work on GNOME 40

Post by eradicator »

The bp button has never worked for me on Firefox. (But with the number of addons I have I never blamed that on the forum.)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Copy-BP button does not work on GNOME 40

Post by DaveMcW »

It seems to randomly fail for me. For example, in this post the first blueprint works and the second one does not.

Looking at the DOM inspector, the working button has id="BPbutton_oqyoxohfk" while the broken button has id="BPbutton". This means javascript failed to activate the button, it is not an OS copy/paste problem.

It is easy to see why it fails, every button starts with id="BPbutton" as the page loads. Then there is a race condition to activate the button's <script> block before another button loads. I am amazed that it works as often as it does.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Copy-BP button fails randomly, and ever more often

Post by ssilk »

I guess this works randomly, because the script looks just for one class. If meanwhile more content is loaded, the script oversees it.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
Sanqui
Factorio Staff
Factorio Staff
Posts: 266
Joined: Mon May 07, 2018 7:22 pm
Contact:

Re: Copy-BP button fails randomly, and ever more often

Post by Sanqui »

I've fixed the button when there are multiple blueprint strings on the same page :) But it may be necessary to edit and re-save old posts.
ovo

Post Reply

Return to “This Forum”