Error in firefox on draw text when run from local

Monkey Forums/Monkey Programming/Error in firefox on draw text when run from local

matty(Posted 2011) [#1]
This is a bizarre error that I don't understand.

Create the following class and save in a module, eg "test.monkey" in a new module folder "test".



In the main module that your program runs from have the following:



Ok..I'm using Firefox 3.5.7.
When I run within monk, it runs fine.
When I run from the web it runs fine (see here:

http://home.swiftdsl.com.au/%7Etmalcolm/error_monkey/

)

However, if run it from my local machine in the build folder, or any other folder on my machine I get an "NS_SECURITY_DOM error "1000"".

If I remove the DrawText command then it runs fine.

I only noticed this when I tried to run one of my games from my local machine instead of from the web....

Strange bug. Although I'm guessing it is something more to do with the browser than monkey.


degac(Posted 2011) [#2]
It is a 'security' problem on Firefox - or a bug of FF if you prefer.
To avoid this Mark introduced Mserver.exe to play locally HTML5 contents from MonkIDE.


matty(Posted 2011) [#3]
Okay thanks,


Samah(Posted 2011) [#4]
This isn't really a bug on Monkey or FF's end. When calling DrawText, it tries to access mojo_font.png, which is included in the data folder. Since you're trying to load the HTML file directly, the browser's javascript engine is (correctly) blocking access to the data directory. Something to do with domains or referrers or something I think.

With one of the recent patches, Mark added MServer (a tiny web server) to host and test HTML5 builds. (degac beat me to it...)


Gerry Quinn(Posted 2011) [#5]
So it's the same as Flash, except that Flash gives you a fix to okay some of your own folders for use with Flash (that little online applet we have to run before we can target Flash)?