Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy doesn't work #98

Open
Andrea-28-03 opened this issue Sep 5, 2023 · 14 comments
Open

copy doesn't work #98

Andrea-28-03 opened this issue Sep 5, 2023 · 14 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Andrea-28-03
Copy link

Andrea-28-03 commented Sep 5, 2023

Like I said in issue #87; I can't copy and paste using the button in the website like Chat gpt or perplexity the copy button doesn't do anything:
image
image
image
(chat gpt let you see that you really clicked the button but after that you haven't copied anything, like perplexity)
I can copy selecting the text and using ctrl+c but it breaks the format and now it take me a lot of time.

Unfortunatelly it doesn't got fixed in Obsidian 1.3.7, like you said.
I'm not forcing iframe, and even if I do that it doesn't change anything

Originally posted by @Andrea-28-03 in #87 (comment)

@Ellpeck Ellpeck added bug Something isn't working help wanted Extra attention is needed labels Sep 5, 2023
@nayyala
Copy link

nayyala commented Sep 21, 2023

+1, am not able to use the copy code from ChatGPT in the iFrame

@bogdaba
Copy link

bogdaba commented Nov 13, 2023

+1

1 similar comment
@Tokyomo
Copy link

Tokyomo commented Dec 18, 2023

+1

Repository owner locked as spam and limited conversation to collaborators Dec 18, 2023
Repository owner unlocked this conversation Dec 18, 2023
@Ellpeck
Copy link
Owner

Ellpeck commented Dec 18, 2023

Hi everyone, I appreciate your feedback on this issue, but please try to use the reaction feature if you're also experiencing it!

@Ellpeck
Copy link
Owner

Ellpeck commented Dec 20, 2023

Hi! For anyone who is having this issue: Does it also occur when embedding the site the issue is happening on in an Obsidian Canvas? If so, this might be an issue with Obsidian rather than this plugin, and something I'd have to chat to Licat about.

@W1BTR
Copy link

W1BTR commented Apr 23, 2024

Seems to depend on the way it's implemented. For example, I cannot copy any locations from google maps when intigrated (right click an area and click on the coordinates. However, Google Keep works when I am copying text.

I believe selecting and copying works, but any code that outputs to the clipboard is blocked.

@JinHongyu2023
Copy link

I also have this problem. When I click the copy button in ChatGPT, the following prompt appears. I haven't found a solution after looking through the messages. Is this problem solvable? Thank you.

image

@HeiMaoJingZhangGiaoGe
Copy link

I'm having this issue as well

@jparkerweb
Copy link

I had a page that I wrote (small utility) and was running into the same issue.
I was able to update my copy function in my javascript as follows and it seems to "play nice" with Obsidian's iframes:

  • Removed the navigator.clipboard API completely since it was being blocked
  • Simplified the implementation to use only execCommand('copy')

my copy function:

// Copy button functionality
function copyToClipboard(text) {
    // Create a temporary textarea element
    const textArea = document.createElement("textarea");
    textArea.value = text;
    
    // Make it invisible but ensure it's in the DOM
    textArea.style.position = "fixed";
    textArea.style.top = "0";
    textArea.style.left = "0";
    textArea.style.width = "2em";
    textArea.style.height = "2em";
    textArea.style.padding = "0";
    textArea.style.border = "none";
    textArea.style.outline = "none";
    textArea.style.boxShadow = "none";
    textArea.style.background = "transparent";
    
    document.body.appendChild(textArea);
    
    try {
        // Select the text
        textArea.focus();
        textArea.select();
        
        // Try to copy
        const successful = document.execCommand('copy');
        
        // Clean up
        document.body.removeChild(textArea);
        
        return successful;
    } catch (err) {
        // Clean up
        document.body.removeChild(textArea);
        console.error('execCommand Error:', err);
        return false;
    }
}

hope this is helpful to others 🤗

@W1BTR
Copy link

W1BTR commented Nov 19, 2024

Sadly none of the services Im adding in there are things I control (Google maps, namely), but good find!

@nevertoday
Copy link

claude fail +1

@nevertoday
Copy link

why this bug not fixed

@W1BTR
Copy link

W1BTR commented Dec 23, 2024

why this bug not fixed

My man doesn't understand development, never mind open-source development 🤣

That said, it would be great to see this fixed. Most use cases I can think of require copying / pasting.

@Ellpeck
Copy link
Owner

Ellpeck commented Dec 23, 2024

Hi! For anyone who is having this issue: Does it also occur when embedding the site the issue is happening on in an Obsidian Canvas? If so, this might be an issue with Obsidian rather than this plugin, and something I'd have to chat to Licat about.

Hi again everyone! Part of the reason this isn't fixed yet is because no one seems to have done any additional investigation. Please check to see if the issues you're describing also happen with the Canvas plugin's embedding feature and now, potentially more importantly, if they happen with the new builtin browser (if you already have access to it) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

10 participants