• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: copy in WebView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy in WebView


  • Subject: Re: copy in WebView
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Fri, 12 Oct 2012 15:47:39 +0700

On 12 Oct 2012, at 00:19, "Gerriet M. Denkmann" <email@hidden> wrote:

>
> On 12 Oct 2012, at 00:11, Kyle Sluder <email@hidden> wrote:
>
>> On Oct 11, 2012, at 10:00 AM, "Gerriet M. Denkmann" <email@hidden> wrote:
>>
>>>
>>> On 11 Oct 2012, at 23:45, Kyle Sluder <email@hidden> wrote:
>>>
>>>> On Oct 11, 2012, at 8:26 AM, "Gerriet M. Denkmann" <email@hidden> wrote:
>>>>
>>>>> I have a WebView which displays text which contains some invisible characters (like ZERO WIDTH SPACE).
>>>>> When I use Edit→Copy these characters are also put on the pasteboard.
>>>>>
>>>>> But this does not make sense. The pasteboard should contain the selected text without these invisible characters.
>>>>
>>>> I challenge this statement. The user selected those characters. They should therefore be copied.
>>>
>>> Ok. New version:
>>> This generally makes sense. But in my special case the pasteboard should contain the selected text without these invisible characters.
>>
>> Can you inject a JavaScript into the page that strips the characters before putting them on the pasteboard?
>
> I have no experience with JavaScript. And no idea how to start.
> I was hoping to just use subclassing and/or delegates.

I managed (using: <body oncopy="return MyJavaScriptFunction()">) to get the selection and modify it (removing unwanted characters) but I do not know how to put the resulting string onto the clipboard.

<http://stackoverflow.com/questions/127040/copy-put-text-on-the-clipboard-with-firefox-safari-and-chrome> seems to imply that this is (for security reasons) impossible.
There is some discussion about using Flash to circumvent this - but I will NOT install Flash on my computer.

So what to do next?

Gerriet.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: copy in WebView
      • From: Kyle Sluder <email@hidden>
References: 
 >copy in WebView (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: copy in WebView (From: Kyle Sluder <email@hidden>)
 >Re: copy in WebView (From: Kyle Sluder <email@hidden>)
 >Re: copy in WebView (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: NSTableView how to sort rows after modify datasource array
  • Next by Date: Re: File browser widget
  • Previous by thread: Re: copy in WebView
  • Next by thread: Re: copy in WebView
  • Index(es):
    • Date
    • Thread