Issue with Structure Editor Conversion Functions

Dear Datagrok team,

I’m experiencing problems with the structure editing window functionality. The conversion buttons for SMILES and molblock formats are not functioning correctly.

The target column contains SMILES strings. Please find the column property details in the attached screenshot.

The same conversion issue occurs regardless of whether the column stores SMILES or molblock format data.

Best regards,

Kosuke

1 Like

Hey Kosuke!

Can you please specify what sort of problem are you experiencing? is it not converting notation? or are there any errors?

Davit

Dear Davit,

Thank you for commenting on my issue.

I’m experiencing a problem where no information is copied when clicking either Copy as SMILES or Copy as MOLBLOCK.

I found the following error messages in the console:

2025-09-17T11:08:21.566Z Cannot read properties of undefined (reading ‘writeText’)
webpack://datagrok-api/src/chem.ts 530:61
packages/d4/src/events.dart 585:7 AppEvents.contextRun
packages/d4/src/widgets/menu/menu.dart 122:7 MenuItem.click
packages/d4/src/widgets/menu/menu.dart 187:33 MenuItem._init.
packages/$sdk/lib/html/dart2js/html_dart2js.dart 42920:48 _EventStreamSubscription.
packages/$sdk/lib/_internal/js_runtime/lib/js_helper.dart 2456:48 invokeClosure.
packages/$sdk/lib/_internal/js_runtime/lib/isolate_helper.dart 474:16 _IsolateContext.eval
packages/$sdk/lib/_internal/js_runtime/lib/isolate_helper.dart 59:16 _callInIsolate
packages/$sdk/lib/_internal/js_runtime/lib/js_helper.dart 2456:14 invokeClosure
packages/$sdk/lib/_internal/js_runtime/lib/js_helper.dart 2476:14 convertDartClosureToJS

Could you please help me resolve this issue?

Best regards,

Kosuke

I see, thank you for the details.

It seems that in the browser you are using, navigator.clipboard is not available.

This can be due to various security reasons, which prohibit any web app from using the clipboard and modifying it.

Are you using HTTPS for your server? using unsecure HTTP can cause unavailability of clipboard API. In simple terms, browser is prohibiting Datagrok from copying anything to clipboard, probably because of HTTP. Bellow is the link to similar discussion on stackoverflow:

If you are using HTTP and internally this is fine, what you can try is to set the chrome flag such that it knows your Address for Datagrok is secure:

chrome://flags/#unsafely-treat-insecure-origin-as-secure

I hope this helps.

Davit.

2 Likes

Dear Davit,

Thank you for sharing how to solve it.

Now I can copy SMILES and MOLBLOCK by setting chrome property.

I really appreciate it.

Best,

Kosuke

1 Like