IBMa / equal-access

IBM Equal Access Accessibility Checker contains tools to automate accessibility checking from a browser or in a continuous development/build environment
Apache License 2.0
615 stars 75 forks source link

Scanning URL gives Permission denied to access document #5

Open devanshah2 opened 7 years ago

devanshah2 commented 7 years ago
APPLIES TO:

(Tool(s) that this defect affects, in the case of rule defect please include the rule name) @ibma/karma-ibma

PROBLEM DESCRIPTION:

(Describe the problem you are seeing in as much detail as you can)

When scanning a URL which is not in the same domain/port/protocol as the karma server it throws exception "permission denied to access property "document""

STEPS TO REPRODUCE:

(Steps to reproduce the issues from start to finish.) (Include a sample html file when possible (attach under the "Links" section), Include a link if sample file cannot be produced.)

  1. Scan https://internetofthings.ibmcloud.com/#/
  2. notice that there will be an exception throw
EXPECTED OUTPUT:

(The expected results that you should see)

No exception, should match baseline

ACTUAL OUTPUT:

(The current results that you are seeing) (Include Description and/or a screenshot of what you are seeing)

permission denied to access property "document"

devanshah2 commented 7 years ago

For this defect the issues is due to cross domain access issues which are causes issues when trying to access the iframe which was created with the src of the URL provided. On firefox there is no provided alternative, Chrome and PhantomJS provide a way to over ride this. by adding the following to karma.config.js

 module.exports = function (config) {
    config.set({
        browsers: ['ChromeCustom', 'PhantomJSCustom'],
        customLaunchers: {
            ChromeCustom: {
                base: 'Chrome',
                flags: ['--disable-web-security']
            },
            PhantomJSCustom: {
                base: 'PhantomJS',
                options: {
                    settings: {
                        webSecurityEnabled: false
                    }
                }
            }

        }
        ....
    });
}