[Macintosh] MacScripter.net website problem

Ask for help about NoScript, no registration needed to post
Schmye Bubbula
Junior Member
Posts: 37
Joined: Thu Jul 12, 2012 9:40 pm

[Macintosh] MacScripter.net website problem

Post by Schmye Bubbula »

The MacScripter.net website for AppleScript aficionados has a special feature for forum posts in which one can put AppleScript code within tags that allow the reader to click a link that passes the code text to their default script editor app. For example, in this post, if you click the link, Open this Scriplet in your Editor, it will launch Apple Script Editor and insert the code in a new document.

My problem is that whenever NoScript is an enabled Firefox extension, even if I Allow Scripts Globally, the text that gets passed to Apple Script Editor has all its line breaks converted to space characters, and the script won't compile. The only way I could find to stop that behavior is if I disable the NoScript extension and re-launch Firefox without it.

Is there some NoScript pref option I'm missing?

Memo: Looking at a MacScripter.net forum thread's page source code, the scripts are in ecaped HTML form in the URLs embedded in the "Open this Scriplet in your Editor:" links, and they contain linefeeds rather than returns... maybe that's a hint:

Code: Select all

<a href="applescript://com.apple.scripteditor?action=new&script=%0A%E2%80%A6%0Aset%20outputFile%20to%20%28%28path%20to%20desktop%20as%20text%29%20%26%20%22LaunchAgent_Alert.txt%22%29%20--%20represents%20%22MacHD%3AUsers%3Adavid%3ADesktop%3ALaunchAgent_Alert.txt%22%0Atry%0A%09set%20fileReference%20to%20open%20for%20access%20file%20outputFile%20with%20write%20permission%0A%09write%20theBody%20to%20fileReference%0A%09close%20access%20fileReference%0Aon%20error%0A%09try%0A%09%09close%20access%20file%20outputFile%0A%09end%20try%0Aend%20try%0A">Open this Scriplet in your Editor</a>
- -
Firefox 48.0.2
macOS 10.6.8
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: [Macintosh] MacScripter.net website problem

Post by therube »

See what this might do for you:

Code: Select all

+ Added a "noscript.fixURI.exclude" about:config preference where
  protocols which should not be escaped by NoScript can be specified
  as a space-separated list
So add applescript to that pref & see if it helps.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120711 Firefox/15.0a2 SeaMonkey/2.12a2
Schmye Bubbula
Junior Member
Posts: 37
Joined: Thu Jul 12, 2012 9:40 pm

Re: [Macintosh] MacScripter.net website problem

Post by Schmye Bubbula »

Bingo! Wow... just wow. Thanks, therube! I'll post your solution over on the aforementioned MacScripters.net thread. I'm sure many Firefox AppleScripters who use NoScript will be most grateful.

about:config
noscript.fixURI.exclude | user set | string | applescript

So tell me, why does NoScript escape that - "fixURI" protocol, is it? - in the first place? Why is it needed? And why does it still do it even in what I would think is the most extreme case when Allow Scripts Globally is enabled? (I previously presumed that was tantamount to disabling NoScript completely, but I guess not.)

(This must be what it's all about. I'll Google around on "fix URI" some more.)
- -
Firefox 48.0.2
macOS 10.6.8
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: [Macintosh] MacScripter.net website problem

Post by Giorgio Maone »

Schmye Bubbula wrote: (This must be what it's all about. I'll Google around on "fix URI" some more.)
Yes it is, and it's not the only instance of stuff like that happening.
Generally speaking, any application which register itself system-wide to handle URIs (e.g. a torrent client for magnet: URIs or a media player for mms: URIs) can be affected vulnerabilities like that, which may even allow remote code execution attacks.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Schmye Bubbula
Junior Member
Posts: 37
Joined: Thu Jul 12, 2012 9:40 pm

Re: [Macintosh] MacScripter.net website problem

Post by Schmye Bubbula »

So somebody explain to me... Until now I thought that the gross (dangerous) setting of NoScript's Allow Scripts Globally was like disabling it completely. But this fixURI thing kept happening even then, as well as when I whitelisted the website that invoked it. So is there an "on/off" switch in NoScript? (I was having to manually disable the extension completely and re-launch Firefox when I visited the AppleScript website until I learned of the about:config pref setting.)
- -
Firefox 48.0.2
macOS 10.6.8
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Post Reply