How to enable CORS (latest FF on a Mac) ? Or is it a TW bug ?

347 views
Skip to first unread message

Gilles Lenfant

unread,
May 19, 2012, 11:11:49 AM5/19/12
to tiddl...@googlegroups.com
Hi,

I tried to import an old and filled with 134 tiddlers TiddlyWiki from a fresh new vanilla TW. Both are in my hard drive.
I use the standard "import" feature from the tools bar. And I got this Error :

Error retrieving tiddlers from url, please ensure this url exists and is CORS enabled

The URL exists since the TW is in my file system and provided by the files browser.

I read the doc about CORS and don't understand why cross scripting issues are involved for TW files that are in my hard drive.

So far so good, I try to find something like "Enable CORS" in the new empty 2.6.5 TW options (AdvancedOptions) and do not find anything related.

As far as I can understand, enabling CORS is done through HTTP response headers headers, but should I install Apache and tweak a host to provide those headers just for importing tiddlers ? A nightmare when the TW import feature worked like a charm with most older versions.

Googling for "Firefox CORS" leaded to an extension that enables CORS in FF : https://addons.mozilla.org/en-US/firefox/addon/forcecors/

I installed it but this did not help : importing tiddlers still drives to the same error message and imports nothing.

I do not want to copy/paste tiddler per tiddler all these 134 tiddlers. (title + content + keywords) this would be a nightmare.

The other related messages in this ML didn't help because the users reported this error message caused from other actions.

I tried the same operation with the other installed bowsers (Safari and Chrome) and had the same issue.

Thanks by advance for any hint. Please speak slowly because I'm far to be a JS expert :)
---
Gilles Lenfant

Eric Shulman

unread,
May 19, 2012, 1:34:25 PM5/19/12
to TiddlyWiki
> I tried to import an old and filled with 134 tiddlers TiddlyWiki from a
> fresh new vanilla TW. Both are in my hard drive.
> I use the standard "import" feature from the tools bar. And I got this
> Error :
>
> Error retrieving tiddlers from url, please ensure this url exists and is
> CORS enabled
>
> The URL exists since the TW is in my file system and provided by the files
> browser. I read the doc about CORS and don't understand why cross scripting issues
> are involved for TW files that are in my hard drive.

Give this a try:

Copy the old file into the *same folder* as the new empty TW. Then,
open the new empty TW, invoke the backstage>import panel, and enter
*only* the filename.ext of the old file without any path info. The
built-in TiddlyWiki importer should find the file (because it is in
the same folder) and read the tiddlers from it.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

----
WAS THIS ANSWER HELPFUL? IF SO, PLEASE MAKE A DONATION
http://www.TiddlyTools.com/#Donations
note: donations are directly used to pay for food, rent,
gas, net connection, etc., so please give generously and often!

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
http://www.TiddlyTools.com/#Contact


Gilles Lenfant

unread,
May 19, 2012, 2:04:29 PM5/19/12
to tiddl...@googlegroups.com
Le samedi 19 mai 2012 19:34:25 UTC+2, Eric Shulman a écrit :
> I tried to import an old and filled with 134 tiddlers TiddlyWiki from a
> fresh new vanilla TW. Both are in my hard drive.
> I use the standard "import" feature from the tools bar. And I got this
> Error :


[...]
 
Give this a try:

Copy the old file into the *same folder* as the new empty TW.  Then,
open the new empty TW, invoke the backstage>import panel, and enter
*only* the filename.ext of the old file without any path info.  The
built-in TiddlyWiki importer should find the file (because it is in
the same folder) and read the tiddlers from it.

Hi Eric,

Thanks for taking some time to help me.
Unfortunately this drives to exactly the same issue. I can't understand why TW import script is expecting CORS related HTTP headers when both TW are published from "file://...". I suspect the error message to be unrelated with CORS stuffs.

Have you an idea on how I could provide the most appropriate information for helping TW experts to find the issue/solution ?

The TW I'm trying to upgrade is a place where I store hints for my job and has nothing personal or confidential. It's in my public dropbox at this address for some days. If a TW maintainer has time to have a look and see what's wrong here :


Cheers, and many thanks by advance to anyone who helps.
-- 
Gilles Lenfant 

Måns

unread,
May 19, 2012, 4:58:48 PM5/19/12
to TiddlyWiki
Hi Gilles

> The TW I'm trying to upgrade is a place where I store hints for my job and
> has nothing personal or confidential. It's in my public dropbox at this
> address for some days. If a TW maintainer has time to have a look and see
> what's wrong here :
>
> http://dl.dropbox.com/u/5767983/RecettesZopePlone.html

When I download your TW and use the importer it seems to work
fine..Debian Squeeze (Linux) Iceweasel 10.0.2 (Mozilla) ...

I've imported Jon's TiddlyFileImportr plugin into your document...
Check if it works for you (it replaces the standard backstage
importer)...

http://xn--mns-ula.dk/TW/Gilles/download.php

(I will remove it again - when you've downloaded it..)

Cheers Måns Mårtensson

Gilles Lenfant

unread,
May 19, 2012, 6:37:04 PM5/19/12
to tiddl...@googlegroups.com
2012/5/19 Måns <huma...@gmail.com>
Hi Gilles

> The TW I'm trying to upgrade is a place where I store hints for my job and
> has nothing personal or confidential. It's in my public dropbox at this
> address for some days. If a TW maintainer has time to have a look and see
> what's wrong here :
>
> http://dl.dropbox.com/u/5767983/RecettesZopePlone.html

When I download your TW and use the importer it seems to work
fine..Debian Squeeze (Linux) Iceweasel 10.0.2 (Mozilla) ...

I've imported Jon's TiddlyFileImportr plugin into your document...
Check if it works for you (it replaces the standard backstage
importer)...

http://xn--mns-ula.dk/TW/Gilles/download.php

Hello Måns,

I downloaded a fresh new TW 2.6.5

I added to this empty TW the  TiddlyFileImportr you provided me, added the two keywords (copy / paste)

I refreshed the TW page and imported the old TW

-> WOOOORK !

Many thanks for this !

What's this TiddlyFileImportr ? Will it be part of the next TW release ?

Mant thanks
-- 
Gilles Lenfant



(I will remove it again - when you've downloaded it..)

Cheers Måns Mårtensson

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To post to this group, send email to tiddl...@googlegroups.com.
To unsubscribe from this group, send email to tiddlywiki+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=en.


Måns

unread,
May 19, 2012, 7:36:23 PM5/19/12
to TiddlyWiki
Hi Gilles

> I added to this empty TW the  TiddlyFileImportr you provided me, added the
> two keywords (copy / paste)
>
> I refreshed the TW page and imported the old TW
>
> -> WOOOORK !

> What's this TiddlyFileImportr ? Will it be part of the next TW release ?

Great :-)

Jon talks about it here:
http://groups.google.com/group/tiddlywiki/browse_thread/thread/946113d81e7e0e59/cf9a4e178b5ac2f1?lnk=gst&q=TiddlyFileImportr#cf9a4e178b5ac2f1

I can't tell if it's getting into the core ...

(I've replaced your TW with an empty TW + TiddlyFileImportr for
reference..)

Cheers Måns Mårtensson

Eric Shulman

unread,
May 20, 2012, 3:44:28 PM5/20/12
to TiddlyWiki
> What's this TiddlyFileImportr ? Will it be part of the next TW release ?

I am currently working on new tooling for building TWClassic using the
new TW5 engine to construct the target document output. Once this is
functioning properly, I will be preparing and posting a new release,
TW2.6.6beta, which will incorporate all committed changes to date, but
will not include any new changes beyond those already committed to the
github repo.

After 2.6.6beta is posted, I will be focused on the "importer"
problems... including a complete review of the TWCore file I/O code to
identify solutions (fixes, patches, plugins, or work-arounds) for both
the CORS and local filesystem access difficulties that have been
introduced by browser updates that have increased their security
restrictions over time. Included in this is the potential to re-use
some of the methods employed by TiddlyFileImportr to handle newer,
more robust file I/O APIs.

enjoy,
-e
Eric Shulman
TWClassic Lead Developer
- - - - - - - - - - -
TiddlyTools / ELS Design Studios
http://www.TiddlyTools.com/#Donations

Professional TiddlyWiki Consulting Services
Reply all
Reply to author
Forward
0 new messages