Javascript: "Permission denied" - how to debug?

hello,
on a website we are currently developing we make use of an adapted version of http://www.brandspankingnew.net/specials/ajaxautosuggest/ajax_autosuggestautocomplete.html
This works fine on a simple test form but fails in Safari 3.1 (Mac and Win) when we include the script in the real web page.
The error console states just plain "Permission denied" - unfortunately it does not tell what exactly and where something fails.
The script does work in all other browsers like Firefox, Camino, windows internet explorer ... only on Safari we get this error.
Is there something else on a mac apart from the Safari-included "Developer tools" that would help me debug this error?
thank you

no
{quote:}
Resource interpreted as script but transferred with MIME type text/html.
http://www.brandspankingnew.net/js/bsn.AutoSuggest2.1.3comp.js
Resource interpreted as stylesheet but transferred with MIME type text/html.
http://www.brandspankingnew.net/css/autosuggest_inquisitor.css
ReferenceError: Can't find variable: bsn
http://tomx.890m.com/test.html? (line 392)
Resource interpreted as script but transferred with MIME type text/html.
http://track.blogcounter.de/js.php?user=gulfstream&style=6
{quote}
but again, the original sample page does work as well as a simple form we use to try our modifications to the script. Only when the script is included in the "real" form page it fails.
And without any hint from safari where exactly it fails it's hard to debug:(
thanks

Similar Messages

  • Backup thunderbird OK but Firefox says permission denied how can l sort this

    l can Backup Thunderbird OK, but when l try Firefox a messagebox comes across the screen that it's not possible access is denied. This happens every time l try to backup firefox

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox > Preferences > Privacy > Cookies: "Show Cookies"
    Please update Firefox to the latest version via "Help > Check for Updates" to get the latest security patches.<br />
    You can find the latest Firefox release in all languages and for all Operating Systems here:
    *Firefox 3.6.x: http://www.mozilla.org/en-US/firefox/all-older.html
    *Firefox 10.0.x: http://www.mozilla.org/en-US/firefox/all.html

  • In onLoad JavaScript, I'm getting "Error: Permission denied to access property 'classes'" when I access Components.classes; how do I enable that permission?

    I need to emulate several ActiveX functions in my client's web application. I have located several Mozilla web pages that describe how to do the things I need, and I have attempted to implement those instructions. However, I can't seem to get past the first line of code. In my web page, I am calling a JavaScript function using the onLoad attribute of the <body> tag. I am using the Navigator object to determine that the browser is Firefox. I then attempt to access the extension classes using the following code on lines 51 and 52 of the Download.js file:
    var C = Components;
    var CC = C.classes;
    The Web Console gives me these two messages:
    [13:51:55.621] The Components object is deprecated. It will soon be removed. @ http://distribution:781/NewDDI/DownLoad.js:51
    [13:51:55.621] Error: Permission denied to access property 'classes' @ http://distribution:781/NewDDI/DownLoad.js:52
    How do I enable adequate permission to be able to access the Components classes?

    I think Components is available only in extensions (or otherwise privileged code) and not in ordinary web pages.

  • Permission denied on apps javascript folder

    I need to distribute an application that generates a folder-level script for writing to an XFA form. I want to store the script at the app level.
    app.getpath("app","JavaScript") returns this folder (on my machine, but some of the other users have later versions): C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\JavaScripts
    The problem is that when I try to save the script I get a "Permission Denied" error.
    Is there a way to overcome that without resorting to the user javascript folder?

    lrosenth wrote:
    Well, we made the change with Acrobat X, IIRC.   I honestly don’t remember whether there were complaints.  But most app-level scripts don’t get installed using the method that you are – they get installed once via a standard software installation tool (which will create the folder if missing)
    But this is a User-level script. I'm not even sure how I could check for the folder's presence without knowing what the USERNAME is.
    For example, this is the javascripts path on my laptop: \Users\Darrell\AppData\Roaming\Adobe\Acrobat\9.0\JavaScripts.
    How would I know if the javascripts folder should be under the USERNAME "Darrell"? There may be multiple User folders, and they may not be the same as the Windows login.

  • Pages downloaded from the App-store refuses to save: Permission denied. How can I download a new one?

    Pages downloaded from the App-store refuses to save: Permission denied. How can I download a new one? Please Advice .

    Is the computer yours, and are you the Administrator or a user with administrator rights? Are you allowed to install software on the computer?
    Check your "purchased" list. Pages should show there, and if it's not installed it should read "install" next to it.
    Have you tried another mac? You can install the purchased software on another Mac by using your AppleID that you purchased the software with on the first mac.
    And yes, kerropas se viesti

  • Error massages: JavaScript application.Error:permission denied to property "host"

    Firefox 4 on Mac 10.6.6 gives repeated error messages when opening any web page.; JavaScript application Error: Permission denied to access property "host"

    follow-up: disabling/removing the add-on '''gPDF''' (v4.01) eliminates the error. I've only tested this on Ubuntu Linux & FFx 4b11...
    Same issue, btw posted [http://support.mozilla.com/en-US/questions/769313]

  • How to resolve "SCRIPT70: Permission Denied" on IE10?

    Hi there,
    One some of IE10/WIN7 machines, the javascript-coded popup menu is disabled on an enterprise web application. I enabled the developer tools and found the following error. It is clear that the issue is not with the web application, but with IE or
    client machine configuration. I have been searching for the solution for one week and still go nowhere.  The javascript is enabled on browser side. What information shall I collect to narrow down the problem? Thank you.
    Error Msg is:
    SCRIPT70: Permission Denied
    PopupMenu.js, line 305 character 1.
    Jay

    I have the same problem.
    I actually have a web site developed with angularJs v1.2.26, with firefox and chrome its all ok, but i
    have the need of compatibility with IE10 and up.
    Sometimes I get the error "SCRIPT70:
    permission denied" and its solved clicking F5 and information is loaded, but its not a real solution.
    I have a route /login when someone enters to my web site, and in this controller the only thing that happens is a redirecto to a url where user is authenticathed with
    SAML.
    The code i have in this login.controller.js is:$window.location.href = '/auth/saml/login';
    I think IE10 has some problem in reload information, or with this code.
    Also when user is logeed and IdP send me the response , user is redirected to my main page for watchinf information. "res.redirect('/') and I have the same error too.
    What could happen? In other browsers all is correct. Could you reach/find a solution?
    Thank you too much.

  • Scp works sftp permission denied - debug sftp-server process ?

    We have a number of servers where we can scp a file on to the server, but when we try and sftp onto the server and put a file we get permission denied. The sftp connection works and we can cd arround just not put a file.
    Its not a file/folder permissions problem.
    Any ideas?
    Is there any way under solaris 10 to put debug on the sftp-server process? you could under solaris 8 but according to the man pages under 10 the options have gone.

    Try turning on logging.
    I typically edit /etc/syslog.conf and add an entry
    local7.info;local7.debug /var/log/sshd
    ensuring the entries are tab delimited.
    Then
    touch /var/log/sshd
    Edit /etc/ssh/sshd_config and change
    SyslogFacility auth
    LogLevel info
    to
    SyslogFacility LOCAL7
    LogLevel debug
    Restart everything:
    svcadm restart system-log
    svcadm restart ssh

  • Permission Denied JavaScript

    Hi,
    I am working on a portal application, I have a jsp which popsup a child jsp.
    The child jsp has to call a var(script variable) in the parent jsp, at this line I am getting
    javasript error Permission denied.
    Please get me your valuavle suggessions.
    Regards
    Abhijith YS

    Hi Thanks for your try,its checked, and its not the case here, all other scripts works
    I am getting javascript on window.opener.theVariableInparent.length
    Regards
    Abhijith Y S
    Edited by: Abhijith YS on Nov 26, 2008 12:04 PM

  • Javascript Application Permission denied to access property '$'

    I can't figure out what is causing this error message. At first I would get JavaScript Application $ is not defined so I disabled plug ins and add-ons (only two of those on this computer) and I thought I had figured out what was causing the second error message but then today the permission denied message popped up. I only have two plugins activated, one for adobe and one for shockwave. As for the addins, I use the same ones on my laptop and don't get this error message.
    Any help would be extremely appreciated!
    Computer is 32bit Windows 7 Dell PC

    To avoid confusion, JavaScript isn't related to a plugin:
    *http://kb.mozillazine.org/JavaScript_is_not_Java
    Is this happening on secure (https) web pages or on a page opened via a normal connection?
    You can try basic steps like these in case of issues with web pages:
    Reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and the cookies from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • BUG:? "permission denied" error in generated javascript of af:table!

    Hi,
    In a JSF page with frames, the generated javascript event handlers (_tableSort and _navSubmit) of a af:table component raise a "permission denied" error in Internet Explorer.
    After this error is raised, nothing work... links, command, etc. do not respond.
    For example:
    1.- Frameset page:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <afh:html>
          <afh:frameBorderLayout id="ttt">
            <f:facet name="center">
              <afh:frame source="http://myserver/myapp/faces/Welcome.jspx" height="500" width="500"
                         id="xxx" name="xxx"/>
            </f:facet>
          </afh:frameBorderLayout>
        </afh:html>
      </f:view>
    </jsp:root>2.- And this is the http://myserver/myapp/faces/Welcome.jspx page (with af:table component):
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <afh:html>
          <afh:head title="Resultado Operacion">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
          </afh:head>
          <afh:body>
            <h:form>
              <af:table emptyText="No items were found"
                        value="#{MBDummy.listaPolizas}" var="row" rows="25">
                <af:column sortable="false" headerText="Pol Prefijo"
                           formatType="text">
                  <af:outputText value="#{row.polPrefijo}"/>
                </af:column>
                <af:column sortable="false" headerText="Pol Secuencia"
                           formatType="text">
                  <af:outputText value="#{row.polSecuencia}"/>
                </af:column>
              </af:table>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
    </jsp:root>When I try to navigate through table pages, Interner Explorer raise the "Permission Denied" error

    Hi,
    Did you ever get any reply to this? I'm now running into the exact same problem, for the exact same reason (app works fine--unless a containing window is being served off another host--then we get Permission Denied). Changing the hosting configuration is, unsurprisingly, not an option. Is there a way around this problem? This is a really critical piece for us.
    Best,
    Avrom
    [edit: I have more information. This Javascript error is raised by a Javascript security feature and is intended to prevent cross-site scripting. If a frame's contents are served by a different server than the surrounding window, the contents of the frame are not allowed access to the other contents of the surrounding window.
    Apparently, a number of ADF Faces components (including the table) have Javascript that attempts to access the top-level window...which means that you *cannot* run ADF faces in a situation like the one you described. Personally, I think that's an ADF Faces bug.
    Our workaround is to abandon the idea of putting the app in a frame...we're going with either a popup or allowing the app to take over the window.]
    Message was edited by:
    Avrom

  • Server Debug Permission denied

    I upgraded to CF8 and now when using the "Server Debug"
    feture in Dreamweaver 8 I get an error. I can skip the error and
    everything seems ok. It is just such a pain to get the error
    message each time I start a debug session.
    The error is:
    The following error has occured while connecting to the
    ColdFusion Server:
    Permission denied for the requested operation.
    Each time I make the error occure an entry is placed in the
    ColdFusion Runtime log:
    user RDSServlet: Permission denied for the requested
    operation
    I am running on MS IIS on a windows XP pro

    Try turning on logging.
    I typically edit /etc/syslog.conf and add an entry
    local7.info;local7.debug /var/log/sshd
    ensuring the entries are tab delimited.
    Then
    touch /var/log/sshd
    Edit /etc/ssh/sshd_config and change
    SyslogFacility auth
    LogLevel info
    to
    SyslogFacility LOCAL7
    LogLevel debug
    Restart everything:
    svcadm restart system-log
    svcadm restart ssh

  • Hi, I have Mac Book It currently at 10.6.8 I want know how to recover the FileVault Password? I tried /Library/Keychains/FileVaultMaster.keychain but it say permission denied when i'm the admin account

    Hi, I have Mac Book It currently at 10.6.8 I want know how to recover the FileVault Password? I tried /Library/Keychains/FileVaultMaster.keychain but it say permission denied when i'm the admin account

    Hi BobRz,
    As this is a new issue for me, I believe I had the incorrect approach, maybe you can help me. What I want to do is recover a few files in my desktop, and some information i had on the iCal application and the Mail application as well.As I do not want to do a full migration into this computer (which is not mine) I believe that starting the damaged MBP in Target mode should allow me to search and cop the files I need. But:
    1. Can I open the Ical and mail apps to look for the info I need while reading it as an external HD  ?
    2. Do the target machine (my friends) still need to be updated to ML o Mavs so that it recognizes my MBP as an external drive if starting it in Target mode ? (no migration assistant)
    Thanks.

  • How To Fix --- TNS-12546: TNS:permission denied

    Following is what I see..
    [gcars0j2:/oracled] lsnrctl start
    LSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 03-JAN-2007 13:05:13
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Starting /oracled/product/10.2.0/Db_3/bin/tnslsnr: please wait...
    TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
    System parameter file is /oracled/product/10.2.0/Db_3/network/admin/listener.ora
    Log messages written to /oracled/product/10.2.0/Db_3/network/log/listener.log
    Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    TNS-12546: TNS:permission denied
    TNS-12560: TNS:protocol adapter error
    TNS-00516: Permission denied
    Solaris Error: 13: Permission denied
    Listener failed to start. See the error message(s) above...

    Thank you thank you thank you.... It worked.
    I thought I had taken care of /var/tmp, but I had messed/missed something. See below, there was a small issue, I had "t" and not "x" for all users (see in bold below. Now it works after I used "chmod 777 .oracle".
    Thanks a lot.
    # cd /var/tmp
    # ls -la
    total 14
    drwxrwxrwx 6 root sys 512 Jan 3 17:05 .
    drwxrwxrwx 44 root sys 1024 Dec 12 08:35 ..
    drwxrwxrwt 2 root dba 1024 Jan 3 16:52 .oracle
    prw------- 1 root root 0 Nov 7 19:22 .sysidtool_in
    prw------- 1 root root 0 Nov 7 19:22 .sysidtool_out
    -rw-r--r-- 1 root root 3 Nov 7 19:19 .sysidtool_pid
    -rw-rw-rw- 1 oracle dbad 0 Jan 2 16:02 EM_TARGET_INSTALLER.lk
    drwxr-xr-x 2 root root 512 Nov 14 22:10 dstreAAANWaWRj
    drwxr-xr-x 3 root root 512 Dec 11 17:36 dstreAAATGa4sb
    drwxr-xr-x 2 root root 512 Nov 5 14:01 dstreAAAnLaiid
    # chmod 777 .oracle
    # ls -la
    total 14
    drwxrwxrwx 6 root sys 512 Jan 3 17:05 .
    drwxrwxrwx 44 root sys 1024 Dec 12 08:35 ..
    drwxrwxrwx 2 root dba 1024 Jan 3 16:52 .oracle
    prw------- 1 root root 0 Nov 7 19:22 .sysidtool_in
    prw------- 1 root root 0 Nov 7 19:22 .sysidtool_out
    -rw-r--r-- 1 root root 3 Nov 7 19:19 .sysidtool_pid
    -rw-rw-rw- 1 oracle dbad 0 Jan 2 16:02 EM_TARGET_INSTALLER.lk
    drwxr-xr-x 2 root root 512 Nov 14 22:10 dstreAAANWaWRj
    drwxr-xr-x 3 root root 512 Dec 11 17:36 dstreAAATGa4sb
    drwxr-xr-x 2 root root 512 Nov 5 14:01 dstreAAAnLaiid

  • Continous mDNSPlatformTCPConnect ("Permission denied") errors. What does this mean? What should I do to resolve this?

    MB Air (1.8GHz); MacOS 10.9.2
    In the System Log I see frequent and, at times, continuous (up to several per second) entries like the following:
    4/16/14 9:00:13.936 AM mDNSResponder[73]: ERROR: mDNSPlatformTCPConnect - connect failed: socket 63: Error 13 (Permission denied) length 16
    While I can't point to any specific system issues that result from this, I do have the following (perhaps related, perhaps unrelated) problems:
    1. Over time, memory pressure gradually increases until, every few days, I need to re-boot. I'm not accustomed to having to perform "maintenance boots" under MacOS. (For example, my Mac Mini, also running Mavericks, runs for weeks/months without needing to re-boot; it's my household media server, running iTunes but that's about it.) Feels like a memory leak to me.
    2. TimeMachine is unpredictable for me. When I have TimeMachine enabled, it will do incremental backups for up to a day or so, then the machine ends up in what looks like a run loop, with apps (such as Mail) in a "not responding" state. Can't reliably force-quit those apps at that time - pretty much have to hard-boot the machine and restart. (Note that I'm using a QNAP NAS disk array; has worked fine in the past, pre Mavericks; I'm running latest/greatest NAS firmware.)
    At any rate, any insights regarding the DNS error (what it means; what triggers it; whether I should care; if so, what I should do to quell it; etc.) deeply appreciated.
    Doug Engfer

    May I ask why you want me to remove the AV software?
    Because it's the likely cause of your problem, and even if it isn't, it's worse than useless.
    1. This is a comment on what you should and should not do to protect yourself from malicious software ("malware") that circulates on the Internet. It does not apply to software, such as keystroke loggers, that may be installed deliberately by an intruder who has hands-on access to your computer, or who has been able to log in to it remotely. That threat is in a different category, and there's no easy way to defend against it. If you have reason to suspect that you're the target of such an attack, you need expert help.
    If you find this comment too long or too technical, read only sections 5, 6, and 10.
    OS X now implements three layers of built-in protection specifically against malware, not counting runtime protections such as execute disable, sandboxing, system library randomization, and address space layout randomization that may also guard against other kinds of exploits.
    2. All versions of OS X since 10.6.7 have been able to detect known Mac malware in downloaded files, and to block insecure web plugins. This feature is transparent to the user. Internally Apple calls it "XProtect."
    The malware recognition database used by XProtect is automatically updated; however, you shouldn't rely on it, because the attackers are always at least a day ahead of the defenders.
    The following caveats apply to XProtect:
    It can be bypassed by some third-party networking software, such as BitTorrent clients and Java applets.
    It only applies to software downloaded from the network. Software installed from a CD or other media is not checked.
    As new versions of OS X are released, it's not clear whether Apple will indefinitely continue to maintain the XProtect database of older versions such as 10.6. The security of obsolete system versions may eventually be degraded. Security updates to the code of obsolete systems will stop being released at some point, and that may leave them open to other kinds of attack besides malware.
       3. Starting with OS X 10.7.5, there has been a second layer of built-in malware protection, designated "Gatekeeper" by Apple. By default, applications and Installer packages downloaded from the network will only run if they're digitally signed by a developer with a certificate issued by Apple. Software certified in this way hasn't necessarily been tested by Apple, but you can be reasonably sure that it hasn't been modified by anyone other than the developer. His identity is known to Apple, so he could be held legally responsible if he distributed malware. That may not mean much if the developer lives in a country with a weak legal system (see below.)
    Gatekeeper doesn't depend on a database of known malware. It has, however, the same limitations as XProtect, and in addition the following:
    It can easily be disabled or overridden by the user.
    A malware attacker could get control of a code-signing certificate under false pretenses, or could simply ignore the consequences of distributing codesigned malware.
    An App Store developer could find a way to bypass Apple's oversight, or the oversight could fail due to human error.
    Apple has so far failed to revoke the codesigning certificates of some known abusers, thereby diluting the value of Gatekeeper and the Developer ID program. These failures don't involve App Store products, however.
       For the reasons given, App Store products, and—to a lesser extent—other applications recognized by Gatekeeper as signed, are safer than others, but they can't be considered absolutely safe. "Sandboxed" applications may prompt for access to private data, such as your contacts, or for access to the network. Think before granting that access. Sandbox security is based on user input. Never click through any request for authorization without thinking.
    4. Starting with OS X 10.8.3, a third layer of protection has been added: a "Malware Removal Tool" (MRT). MRT runs automatically in the background when you update the OS. It checks for, and removes, malware that may have evaded the other protections via a Java exploit (see below.) MRT also runs when you install or update the Apple-supplied Java runtime (but not the Oracle runtime.) Like XProtect, MRT is effective against known threats, but not against unknown ones. It notifies you if it finds malware, but otherwise there's no user interface to MRT.
    5. The built-in security features of OS X reduce the risk of malware attack, but they are not, and never will be, complete protection. The best defense is always going to be your own intelligence. With the possible exception of Java exploits, all known malware circulating on the Internet that affects a fully-updated installation of OS X 10.6 or later takes the form of so-called "Trojan horses," which can only have an effect if the victim is duped into running them. The threat therefore amounts to a battle of wits between you and the scam artists. If you're smarter than they think you are, you'll win. That means, in practice, that you always stay within a safe harbor of computing practices. How do you know when you're leaving the safe harbor? Below are some warning signs of danger.
    Software from an untrustworthy source
    Software of any kind is distributed via BitTorrent. or Usenet, or on a website that also distributes pirated music or movies.
    Software with a corporate brand, such as Adobe Flash Player, doesn't come directly from the developer’s website. Do not trust an alert from any website to update Flash, your browser, or anything else.
    Rogue websites such as Softonic and CNET Download distribute free applications that have been packaged in a superfluous "installer."
    The software is advertised by means of spam or intrusive web ads. Any ad, on any site, that includes a direct link to a download should be ignored.
    Software that is plainly illegal or does something illegal
    High-priced commercial software such as Photoshop is "cracked" or "free."
    An application helps you to infringe copyright, for instance by circumventing the copy protection on commercial software, or saving streamed media for reuse without permission.
    Conditional or unsolicited offers from strangers
    A telephone caller or a web page tells you that you have a “virus” and offers to help you remove it. (Some reputable websites did legitimately warn visitors who were infected with the "DNSChanger" malware. That exception to this rule no longer applies.)
    A web site offers free content such as video or music, but to use it you must install a “codec,” “plug-in,” "player," "downloader," "extractor," or “certificate” that comes from that same site, or an unknown one.
    You win a prize in a contest you never entered.
    Someone on a message board such as this one is eager to help you, but only if you download an application of his choosing.
    A "FREE WI-FI !!!" network advertises itself in a public place such as an airport, but is not provided by the management.
    Anything online that you would expect to pay for is "free."
    Unexpected events
    You open what you think is a document and get an alert that it's "an application downloaded from the Internet." Click Cancel and delete the file. Even if you don't get the alert, you should still delete any file that isn't what you expected it to be.
    An application does something you don't expect, such as asking for permission to access your contacts, your location, or the Internet for no obvious reason.
    Software is attached to email that you didn't request, even if it comes (or seems to come) from someone you trust.
    I don't say that leaving the safe harbor just once will necessarily result in disaster, but making a habit of it will weaken your defenses against malware attack. Any of the above scenarios should, at the very least, make you uncomfortable.
       6. Java on the Web (not to be confused with JavaScript, to which it's not related, despite the similarity of the names) is a weak point in the security of any system. Java is, among other things, a platform for running complex applications in a web page, on the client. That was always a bad idea, and Java's developers have proven themselves incapable of implementing it without also creating a portal for malware to enter. Past Java exploits are the closest thing there has ever been to a Windows-style virus affecting OS X. Merely loading a page with malicious Java content could be harmful.
    Fortunately, client-side Java on the Web is obsolete and mostly extinct. Only a few outmoded sites still use it. Try to hasten the process of extinction by avoiding those sites, if you have a choice. Forget about playing games or other non-essential uses of Java.
    Java is not included in OS X 10.7 and later. Discrete Java installers are distributed by Apple and by Oracle (the developer of Java.) Don't use either one unless you need it. Most people don't. If Java is installed, disable it—not JavaScript—in your browsers.
    Regardless of version, experience has shown that Java on the Web can't be trusted. If you must use a Java applet for a task on a specific site, enable Java only for that site in Safari. Never enable Java for a public website that carries third-party advertising. Use it only on well-known, login-protected, secure websites without ads. In Safari 6 or later, you'll see a lock icon in the address bar with the abbreviation "https" when visiting a secure site.
    Stay within the safe harbor, and you’ll be as safe from malware as you can practically be. The rest of this comment concerns what you should not do to protect yourself.
    7. Never install any commercial "anti-virus" or "Internet security" products for the Mac, as they all do more harm than good, if they do any good at all. If you need to be able to detect Windows malware in your files, use one of the free security apps in the Mac App Store—nothing else.
    Why shouldn't you use commercial "anti-virus" products?
    To recognize malware, the software depends on a database of known threats, which is always at least a day out of date. Research has shown that most successful attacks are "zero-day"—that is, previously unknown. Recognition-based malware scanners do not defend against such attacks.
    Their design is predicated on the nonexistent threat that malware may be injected at any time, anywhere in the file system. Malware is downloaded from the network; it doesn't materialize from nowhere.
    In order to meet that nonexistent threat, the software modifies or duplicates low-level functions of the operating system, which is a waste of resources and a common cause of instability, bugs, and poor performance.
    By modifying the operating system, the software itself may create weaknesses that could be exploited by malware attackers.
    Most importantly, a false sense of security makes you more vulnerable.
    8. An anti-malware product from the App Store, such as "ClamXav," has the same drawback as the commercial suites of being always out of date, but it does not inject code into the operating system. That doesn't mean it's entirely harmless. It may report email messages that have "phishing" links in the body, or Windows malware in attachments, as infected files, and offer to delete or move them. Doing so will corrupt the Mail database. The messages should be deleted from within the Mail application.
    An anti-virus app is not needed, and cannot be relied upon, for protection against OS X malware. It's useful only for detecting Windows malware, and even for that use it's not really effective, because new Windows malware is emerging much faster than OS X malware. Windows malware can't harm you directly (unless, of course, you use Windows.) Just don't pass it on to anyone else.
    A Windows malware attachment in email is usually easy to recognize by the file name alone. An actual example:
    London Terror Moovie.avi [124 spaces] Checked By Norton Antivirus.exe
    You don't need any software to tell you that's a Windows trojan. Software may be able to tell you which trojan it is, but who cares? In practice, there's seldom a reason to use recognition software unless an institutional policy requires it. Windows malware is so widespread that you should assume it's in every unknown email attachment until proven otherwise. Nevertheless, ClamXav or a similar product from the App Store may be useful if an ill-informed network administrator says you must run some kind of "anti-virus" application.
    The ClamXav developer won't try to "upsell" you to a paid version of the product. Other developers may do that. Don't be upsold. For one thing, you should not pay to protect Windows users from the consequences of their choice of computing platform. For another, a paid upgrade from a free app will probably have all the disadvantages mentioned in section 7.
    9. It seems to be a common belief that the built-in Application Firewall acts as a barrier to infection, or prevents malware from functioning. It does neither. It blocks inbound connections to certain network services you're running, such as file sharing. It's disabled by default and you should leave it that way if you're behind a router on a private home or office network. Activate it only when you're on an untrusted network, for instance a public Wi-Fi hotspot, where you don't want to provide services. Disable any services you don't use in the Sharing preference pane. All are disabled by default.
    10. As a Mac user you don't have to live in fear that your computer may be infected every time you install software, read email, or visit a web page. But neither should you assume that you will always be safe from exploitation, no matter what you do. The greatest harm done by security software is precisely its selling point: it makes people feel safe. They may then feel safe enough to take risks from which the software doesn't protect them. "Hmmmm, this torrent is a crack of that new game I want. I think I'll download it. It could be a trojan, but the antivirus will warn me if it is." Then they wonder why their Mac is so slow all of a sudden. It's slow because it's running flat out mining Bitcoins for a hacker who has already sold their credit card number and banking passwords to a criminal gang. Maybe a week later the antivirus does warn them, but what good does that do?
    Nothing can lessen the need for safe computing practices.

Maybe you are looking for