Pasting crash: Connection Failure, Network API cannot honor.

JJ
JJSlote
Posts: 621
Joined: Tue Oct 26, 2010 5:44 pm
Platform: Windows
Location: Unlogged bugs thru RC8:  t=61527 HTML clipboard miscode; 62407 Multiselect on edit

Thu Apr 10, 2014 1:10 pm Post

Beta 1.7.0.4 has been crashing on certain pastes from the web, with this popup message:

Connection Failure... the Network Access API cannot honor the request because the protocol is not known.

I'll bet it's because we've lately gained the ability to paste live images with the text, rather than placeholders. This introduces much complexity in pulling remotely hosted images for Scrivener's local use.

Can't provide an example just yet, because the copy was via a Firefox add-on, Easy Copy. This offers the advantage of enabling the user to make a template like this:

Code: Select all

<b>%page_title%</b> <p>
%html_source%</p><p>
%links_html%</p><p>
via <a href="%page_url%">%page_title%</a> - %date% %time% </p>

A straight copy of the same selection from Firefox doesn't generate the error on paste. Anyway, there's no perfect paste between programs; it's always an adaptation of some sort. The return code here just needs a more detailed error message and a graceful recovery.

Rgds -- Jerome

User avatar
LAP
Posts: 1023
Joined: Tue Sep 21, 2010 5:25 pm
Platform: Windows
Location: Sydney
Contact:

Tue Apr 15, 2014 2:58 am Post

Thanks Jerome.

Lee

JJ
JJSlote
Posts: 621
Joined: Tue Oct 26, 2010 5:44 pm
Platform: Windows
Location: Unlogged bugs thru RC8:  t=61527 HTML clipboard miscode; 62407 Multiselect on edit

Thu Apr 17, 2014 2:05 pm Post

Here's a copy and paste that generates a non-fatal Connection Failure from Firefox's built-in Copy rather than the add-in. In Firefox, select any portion of the following article that contains its main image. Copy and paste into Scrivener.

http://nplusonemag.com/what-happened-to-canada

A look at the copied clip in the HTML editor Kompozer suggests that the Scrivener routine is tripping up on this spec:

Code: Select all

<div class="illo_holder"><img
src="http://nplusonemag.com/images/txp/image.php?width=625&amp;quality=95&amp;image=http://nplusonemag.com/images/txp/1432.jpg"
alt="" class="illustration">
</div>


This is an excellent example of what we've been discussing in the "Help > About" thread. Scrivener isn't a browser and is almost certainly not going to be able to pull an image that is inserted dynamically via a PHP script except by going about it indirectly, via a programmable browser control.

Rgds -- Jerome

Jo
Jono
Posts: 49
Joined: Mon Oct 21, 2013 5:07 pm
Platform: Windows

Mon Feb 23, 2015 3:01 pm Post

From reading the other posts this thread (or is threads in the post?) I can see this is a known issue. So this is just to let you know it also happens when pasting content from a WordPress site, when the WordPress site is being edited. Pressing OK unexpectedly closes Scrivener, sometimes with the pasted content, sometimes without.

importing-from-web-page.png
importing-from-web-page.png (53.01 KiB) Viewed 2220 times

User avatar
MimeticMouton
Posts: 8824
Joined: Wed May 05, 2010 5:39 am
Platform: Mac + Windows
Location: city of rain
Contact:

Tue Feb 24, 2015 1:39 am Post

Thanks, we've made some adjustments for the next release which should address the crash. It's not always possible to copy all contents from a webpage--e.g. injected images can cause problems. You may want to try using Paste and Match Style to paste as plain-text, which should avoid the issues causing the error and crash, or importing the page as a PDF rather than copying the contents.
Jennifer Hughes
(MM for short)