Phrase duplication in Chrome

357 views
Skip to first unread message

Cole Tuininga

unread,
Aug 1, 2021, 10:38:55 PM8/1/21
to autokey-users

Hey folks - I've run into a bit of an odd situation with autokey that I
was hoping perhaps somebody would have some insight into.

I have a fair number of plain old simple phrases (for working on data
entry for a wiki I maintain). I took a couple weeks away from it, and
came back to some strange behaviour.

When I trigger a phrase in Chrome or Brave browsers, the phrase gets
duplicated. That is, it shows up twice.

No other programs exhibit this behaviour - not Opera, not text editors,
not Thunderbird (where I'm composing this message). Only with those two
very specific browsers.

I've tried disabling all extensions (of which there really weren't very
many anyhow), and no change in behaviour.

If I HAVE to, I suppose I could work on the wiki in Opera :/ but I'd
really prefer not to have to resort to that. :D

I'm running autokey 0.95.10 on Linux Mint, Chrome 92.0.4515.107 and
Brave 1.27.109 (Chromium 92.0.4515.115). Happy to provide any other
relevant information that might help.

Thank you in advance. :)

--
Cole Tuininga
cole.t...@gmail.com
http://www.tuininga.org/

jos...@main.nc.us

unread,
Aug 2, 2021, 7:57:12 PM8/2/21
to autoke...@googlegroups.com
I bet you just updated Chrome.

See if https://github.com/autokey/autokey/issues/587 matches your problem.

Joe
> --
> You received this message because you are subscribed to the Google Groups
> "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to autokey-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/d270ef05-dcf9-8f44-54ed-6973b2077efe%40gmail.com.
>


Cole Tuininga

unread,
Aug 3, 2021, 6:22:14 PM8/3/21
to autoke...@googlegroups.com
On 8/2/21 7:57 PM, jos...@main.nc.us wrote:
> I bet you just updated Chrome.
>
> See if https://github.com/autokey/autokey/issues/587 matches your problem.

Oh - interesting. I don't remember for sure if Chrome was recently
updated or not, but I certainly can't discount that possibility. Read
through a bit of the thread, and I will say that trying to use the Qt
client did not change the behavior.

I tried Firefox and it does work, so I'll just operate from there for
now. Thanks for the pointer to this!

jos...@main.nc.us

unread,
Aug 4, 2021, 10:09:08 AM8/4/21
to autoke...@googlegroups.com
To paraphrase an old blues song: "When you get you a browser, you know you
better get two, cause you never know what one browser's gonna do." LOL

There are some web pages that test standards compliance. Vivaldi does
pretty well, but no browser gets 100%.

I have around five of them. I use Vivaldi for almost everything. I use
Firefox for the CUPS printer administration web page that Vivaldi won't
do. Waterfox is for using old Firefox add-ons that don't work any more.
And Brave is so I can earn BAT tokens for viewing opt-in curated ads. (I
also earn DATA tokens from the Swash add-on for Brave and Vivaldi - and on
the Kiwi browser on my Android smartphone.) The only one I definitely
won't have is Chrome because it's so terribly invasive and getting worse.

Joe
> --
> You received this message because you are subscribed to the Google Groups
> "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to autokey-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/8aa382ea-bf23-b8b9-e759-9ea17412ff94%40gmail.com.
>


bjo...@gmail.com

unread,
Aug 11, 2021, 5:54:47 AM8/11/21
to autokey-users
Hi Joe,

this is slightly off topic - but do you have any insight into what is wrong with Chrome? :) OK, that's a bit general :)

What I mean is this: For example, there are certain cut/paste actions that do not work (for example in Notion.so), that do work in Firefox. I've also just noticed that I can no longer paste formatted html from Zotero to Chrome, but it works in Firefox. However, I've also noticed some slightly odd behaviour with Discord and autokey (very occasionally grabbing a keyboard shortcut it shoudl not grab, which also happens in Chrome).

This makes me think that this is maybe to do with the frameworks Chrome / Discord use vs. the Framework that Firefox uses. So - are these issues with Chrome on Linux to do with Chrome (and one should therefore post in that forum) OR are these issues to do with the underlying frameworks in which Chrome and maybe Discord and other apps are build?

Any insight would be really appreciated!
Bjoern

jos...@main.nc.us

unread,
Aug 11, 2021, 8:56:47 PM8/11/21
to autoke...@googlegroups.com
Nope, but that won't stop me from commenting. :)

First, while we probably shouldn't be discussing "the price of tea in
China", this list is sufficiently low volume that I don't see any problem
with talking about the occasional related topic.

AFAIK, there are only three browser frameworks in general use and none of
them get everything right. Vivaldi (based on the chromium framework) does
pretty well.

One of the problems is that there are no regulations on webpage coding.
While this is a good thing, it also means that there are a lot of
non-standard and poorly coded pages out there that browsers still have to
try to cope with. Adhering to the many standards would be hard enough
without this.

Clearly, almost no software is designed to work with third party desktop
automation tools. It's pretty great that AutoKey works at all.

In the old days, before mice, many application buttons had one letter in
their label underlined or highlighted and you could press Alt plus that
letter to immediately navigate to that button and press it. Those few that
are left are great for use with AutoKey, but they're almost all gone.

Formatted text: Sometimes formatted text from one application doesn't work
right when you paste it into another application. When I'm having trouble
with this (usually with something I want to print), I first paste it into
LibreOffice Writer which is pretty good with such things. From there, if
it still won't cooperate, you may be stuck with either using it as an
attached or linked file or pasting as plain text which strips out the
formatting, but still gets you the content.

Joe
> https://groups.google.com/d/msgid/autokey-users/8fd1e1ea-8f63-47de-8a49-e3cb86261ff5n%40googlegroups.com.
>


Message has been deleted

Little Girl

unread,
Aug 12, 2021, 10:07:28 PM8/12/21
to autokey-users
Hey there,

Some of your issues could be as a result of settings being different from one browser to another. If one enables certain features and another blocks them, you could see vastly different behavior in them.Add-ons or extensions can also play a part in causing different behavior from one browser to another. Etc., etc., etc. Also, your subject line mentioned phrase duplication in Chrome. That can probably be defeated by using Joe's famous trick of inserting a delay into your code. This example uses a four-second delay and you may need to fiddle with that number to get it just right to defeat odd behavior in some browsers:

time.sleep(4)

Back to the differences in the various browsers: As Joe pointed out, their developers all do their own thing and don't adhere to any one shared standard. This has long been a nightmare for anyone who codes web pages. If you write your code to be friendly in all the bigger browsers, you have to know that this one needs this particular code for this type of JavaScript while that one needs this other particular code for that same type of JavaScript while yet another one couldn't run that type of JavaScript no matter what you try. Likewise, you need to know that each needs specific types of CSS and/or can't do certain things that one or more of the others can do. If you have a sufficiently advanced page, the underlying code can end up being a rather snarled mess just to make all of that happen smoothly.

Meanwhile, you may be able to at least make life a bit less painful when it comes to dealing with various browsers with an AutoKey script that can take a specific action based on which type of browser you happen to have open or open a specific one if none are open. This example script checks for Chromium, Firefox, or Vivaldi, but you could specify others or add to that list as you like. In this example, the script checks if you have a browser open and, if you have one of the specified browsers open, focuses its window to make it the active one. If you have no browser open, it displays a message in a dialog window. There's also some commented-out code beneath that dialog that you could enable (and possibly edit) to choose a specific browser to open and focus if none is currently open. Last, but not least, you can change anything in the script to get it to do whatever you like based on its findings. Since Google doesn't offer the ability to paste code any more, I put the script onto Pastebin on the https://pastebin.com/gNeZ2Lh5 page.

bjo...@gmail.com

unread,
Aug 18, 2021, 8:00:46 AM8/18/21
to autokey-users
Hi everyone,

Thank you all for those comments - that's really interesting. I'm going to take the chance and take the conversation even further afield :)

This is very specific, but I am hoping somebody might have some insights. I use Zotero, a reference manager. In Zotero, when I copy a bibliography to the clipboard, and then paste into a (Google Doc) in Firefox/Linux, all is well. However, when I paste to Chrome/Linux, the pasted text starts with

��<�div class...

I.e., there are stray characters and the text is not interpreted as html, but passed as plain text.  When I copy first to Firefox/Linux, then copy again and paste to Chrome, all is well. 

So Zotero->Firefox works, Chrome->Firefox works, but Zotero->Chrome does not. The best I can come up with is that there's something wrong in Gnome (Ubuntu 20.04 LTS) signalling that the clipboard is html.

Does anybody have any insight into what could be causing this?
Bjoern

Johnny Rosenberg

unread,
Aug 18, 2021, 5:34:26 PM8/18/21
to autoke...@googlegroups.com
Den tors 12 aug. 2021 kl 02:56 skrev <jos...@main.nc.us>:
Nope, but that won't stop me from commenting. :)

First, while we probably shouldn't be discussing "the price of tea in
China", this list is sufficiently low volume that I don't see any problem
with talking about the occasional related topic.

AFAIK, there are only three browser frameworks in general use and none of
them get everything right. Vivaldi (based on the chromium framework) does
pretty well.

Which one is the third? Every browser I've tried except Firefox seems to be built on Chromium, including Vivaldi, Opera, Chrome, and many more.
I have not only AutoKey, I also have my own custom keyboard layout, and that only works properly in Firefox. Every Chromium based web browser fails in exactly the same way for me with my keyboard layout used. I even filed a bug report to the Chromium team, but I got the impression that they fail to understand what the heck I'm talking about. I even sent them my keyboard layout (those evdev files), but they didn't understand why they would need them and since I explained I've heard nothing from them what so ever, so I have no hope that it will be corrected, so I simply just use Firefox for everything, and it works perfectly no matter what keyboard layout I use, and I think AutoKey works perfectly in Firefox too.


Kind regards

Johnny Rosenberg

Little Girl

unread,
Aug 18, 2021, 6:19:08 PM8/18/21
to autoke...@googlegroups.com
Hey there,

bjo...@gmail.com wrote:

>So Zotero->Firefox works, Chrome->Firefox works, but Zotero->Chrome
>does not. The best I can come up with is that there's something
>wrong in Gnome (Ubuntu 20.04 LTS) signalling that the clipboard is
>html.
>
>Does anybody have any insight into what could be causing this?

This page might be of some use:

https://forums.zotero.org/discussion/24136/default-encoding-in-bibtex-export

There's no final solution, but the suggestion to check and adjust
your export settings might help.

This page might also be of some use, suggesting that the type of
input could affect Zotero's output:

https://forums.zotero.org/discussion/13438/strange-characters-stored-in-zotero-db

This page also suggests that the type of input could affect Zotero's
output and offers a suggestion for a way around it using AutoHotkey:

https://forums.zotero.org/discussion/18313/special-characters

AutoKey should be able to do anything AutoHotkey can do. You'd just
have to script it. If I'm understanding this correctly, I imagine
that you could script it so that you select and copy the text to get
it onto the clipboard, then run an AutoKey script to take the copied
text off of the clipboard, convert its characters to proper ones, and
put the result back onto the clipboard, which you could then paste
wherever you like.

--
Little Girl

There is no spoon.

jos...@main.nc.us

unread,
Aug 19, 2021, 11:42:58 AM8/19/21
to autoke...@googlegroups.com
There's a library (or set of them) called WebKit. https://webkit.org

Apparently Safari and other Mac stuff uses it, but I also see it getting
updated on my system, so something here must be using it.

I did some poking around. konqueror uses a thing called KHTML and can also
be configured to use WebKit. I haven't used konqueror in ages, but it
always seemed to work when I did.
>> https://groups.google.com/d/msgid/autokey-users/73ea397e28d025ae86e50946956b2d30.squirrel%40main.nc.us
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to autokey-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/CADo7T4eoW_ohbqRFig%3D6kkXbH5v7wsNepQZun6SRi74vQi5tmw%40mail.gmail.com.
>


jos...@main.nc.us

unread,
Aug 19, 2021, 12:06:33 PM8/19/21
to autoke...@googlegroups.com
Little Girl offered a bunch of specific help, so I'll go general.

The "garbage" at the top of your info looks like JavaScript or something
similar that wasn't detected and interpreted correctly. Apparently,
Firefox understands whatever it is and renders it internally. When it then
sends it back out, it encodes it differently - in a form your application
does understand.

If your data isn't structured/formatted in some special language like
XHTML/JSON ..., then the usual workaround is to copy it and then Paste as
plain text which will strip out most or all of the funny stuff. Many
applications have such an option. If not, pasting into a text editor will
usually strip out most or all of that stuff and reveal whatever got left
behind.

Once you have a mostly plain text file, you can edit it manually or run it
through any number of tools to finish the cleanup. Sed and awk are my
favorites for such things, but you can use anything that's good with
manipulating character string data - even Python with the strings()
module.

If your data is structured, converting it to plain text will make it
unusable to the targeted applications, but it may still be useful if you
want to do things like run it through search tools such as grep or do
statistics like word counts on it.

Joe
> --
> You received this message because you are subscribed to the Google Groups
> "autokey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to autokey-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/autokey-users/6fe5c14d-6f83-4743-9e5f-2857ee572e12n%40googlegroups.com.
>


Reply all
Reply to author
Forward
0 new messages