Web Dialog on MAC
-
Got some problems to run my plugin ( vid2su.rb ) on MAC. There's an error: Method not allowed
- requested method POST for URL.... I know some of the solutions for that in general. But here it is only on MAC. Windows runs fine.
Is it possible that there is a problem with safari and Web Dialog Browsers, that I do not know?
Burkhard
- requested method POST for URL.... I know some of the solutions for that in general. But here it is only on MAC. Windows runs fine.
-
@burkhard said:
Got some problems to run my plugin ( vid2su.rb ) on MAC. There's an error: Method not allowed
- requested method POST for URL.... I know some of the solutions for that in general. But here it is only on MAC. Windows runs fine.
Is it possible that there is a problem with safari and Web Dialog Browsers, that I do not know?
Burkhard
If you are using execute_script() that could be your problem. Its borked on Mac.
- requested method POST for URL.... I know some of the solutions for that in general. But here it is only on MAC. Windows runs fine.
-
Thanks, CP but it occurs only by using the WebDialog Browser in Sketchup.
The Webside itselfs works perfectly on MAC ( Safari ). That is I reckon a conflict between WDB and MAC.The error message is typical for script ( js ) problems. But there must be another solution.
Where can I get some information about using WDBrowsers in Sketchup?Burkhard
-
There are several problems with Safari and WebDialogs. Most of the problems seem to be centered around actually accessing the internet through the WD (either callbacks to SU from web pages, your posts issue, etc). Talks with one of the SU folks indicated it's a Safari issue; talks with someone who knew someone with knowledge of Safari inner workings said it was a SU issue. The point? We don't know the source of the problem, only that a problem exists. Hopefully, it will be fixed before SU7...
-
Thanks Rick!
Einen schönen TagGruß Burkhard
-
@cphillips said:
If you are using execute_script() that could be your problem. Its borked on Mac.
Is this still correct? Can execute_script be used at all on a Mac?
Edit: Found a clue here and will try what Chris suggests (calling pre-defined js functions in execute_script.)
-
@jim said:
@cphillips said:
If you are using execute_script() that could be your problem. Its borked on Mac.
Is this still correct? Can execute_script be used at all on a Mac?
Edit: Found a clue here and will try what Chris suggests (calling pre-defined js functions in execute_script.)
Yes it is still messed up. The string you pass to execute_script can be mangled in a number of ways on Mac. I found so many different problems that I gave up using it for anything but a simple function call with no arguments.
BUT. I just recently found a work around for Mac. Instead of calling execute_script with a string, write the string to a disk file (like frag.js) and then call a JavaScript function that will load the frag. Same result but it seems to work on both platforms.
//javascript function that will load and execute file frag.js. function loadScriptFrag() { var fileref=document.createElement('script') fileref.setAttribute("type","text/javascript") fileref.setAttribute("src", "./frag.js") if (typeof fileref!="undefined") document.getElementsByTagName("head")[0].appendChild(fileref) }
-
On a related note. The callbacks from javascript to ruby also have issues. Both on Mac and PC the return value string can be mangled.
Instead I put return values in a hidden text field in my html and fetch them via WebDialog.get_value(). As far as I can tell its foolproof.
Advertisement