{"_id":"@krakenjs/cross-domain-utils","_rev":"25-fde5f968d888cd780c9126a9431b0db0","name":"@krakenjs/cross-domain-utils","dist-tags":{"beta":"2.0.38-beta.5","alpha":"4.0.0-typescript.2","latest":"3.1.0"},"versions":{"2.0.39":{"name":"@krakenjs/cross-domain-utils","version":"2.0.39","keywords":["template"],"_id":"@krakenjs/cross-domain-utils@2.0.39","maintainers":[{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"565c0fa025d417887413c5c5bee6bd5e8e32689d","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-2.0.39.tgz","fileCount":21,"integrity":"sha512-/TV6Zo13WqbT9PD2x5E23ziF7I5TCXfkzWpbqO/tD2gN6B29zfiTsXIH27y7ZDnQtUyRuDRrk1hxyj2zR2QYEA==","signatures":[{"sig":"MEUCID9/7hIJhcOtOpvQ4pVwGd8tIH0ZNHMyyH0Mn1pQAjfSAiEApkhmK8kLPVzmv16OatBcyxxqicN8Tf7r/REsiQ/ig/Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200269,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCr6NCRA9TVsSAnZWagAAtIkP/RGz8mmOk4gjsESZEaQI\n9z2RP+2clipwjI1hnfk6yu+4SakJR1Q3Ygx86n9RDNZwL4OstVbopkSTZbIN\nJ8S3BQczKHdXJE0WX9t5C3budEXB/9Y5I8f+hAJnTd3lu0RFbj4mqKA0uTF3\nRmWwbk7PQD0A8wuRVq0zuZLQNd/y9jBIH+bRBDgAM4QtMqwjwwszi1pfMo8y\nzeO6CjuhyuQrc12fTVwEAwwqWXSnMnw8kPrHF4Gv13R9yjSdKHZ+Ivz9dau2\nhGLUvjuhKGoOAnE/LP5igLfVEIO7Tzjnu/yhwBQkd8++E+cpExD84ATUpegu\nLRBThFP7EJ0S9MSEXavzxEKtu02D4JvVJQBdUW286tD5tXV2zQciIAXQDoFD\nl6ZjH+edBRPjWmLLN7yLWHiDbRGppFddkArkhHgXSoukF8yfk9wvWrsQtm1F\n/k2gFCFrkbBBUvg5YgalQDKyMJ9VQUSzrcJfRVsPsOBmrzy/ckhaJnFdje/p\nlkFMyncPnCfJhoJRmpUo+GmHoDhdCGLyz7+Bmsl+Nx0oxIjAo4f6cKF2tT+w\nvEHgbKfuruF9qj1uZF4ZtnjX/EFhB41gOiV29+xMvnOFCyDmIuZYy9SFEtAw\n78aj0m4vqfwQNrVBkX9MTO5P6diL9jZMhs5bVYLp+Rs9VkgGxu3xvkZ1fMcd\nw82z\r\n=ddpu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"dist/module/index.js","gitHead":"04fe58024be45ecc7eef2dbbdf147008d19096ce","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir dist/module","build":"npm run test && npm run babel && npm run webpack","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"./publish.sh","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","release:major":"./publish.sh major","release:minor":"./publish.sh minor","release:patch":"./publish.sh patch"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache 2.0"}],"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.12","description":"Javascript module template.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"zalgo-promise":"^1.0.11"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","mocha":"^4","flow-bin":"0.155.0","grumbler-scripts":"^3"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_2.0.39_1644871309502_0.9036894240770856","host":"s3://npm-registry-packages"}},"2.0.38-beta.1":{"name":"@krakenjs/cross-domain-utils","version":"2.0.38-beta.1","keywords":["template"],"_id":"@krakenjs/cross-domain-utils@2.0.38-beta.1","maintainers":[{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"869d9e1a232ed352654285da38bb04c494b900e2","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-2.0.38-beta.1.tgz","fileCount":21,"integrity":"sha512-p5egBGXH+o+3vMrJKxjkwrHm9ehFikDTMKYLBje9IgpgNPvfB7z6QKvxTZjiMxnLQwdqWp9VklBtUB+yw1FBww==","signatures":[{"sig":"MEYCIQDSmbiCcYNQD+vPuAd2HsFg3yk2suwQqKz5vQVjdvi5IQIhAIEBlgt/EQ14Do79T1diF1nMJHPmQTtk4RCTwI5rOFLt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":159179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCr8hCRA9TVsSAnZWagAAHqQP/1tODkVOUSUZ9QxsuFxQ\ni8RdLHa34VVNkzhkhZpxc6SevQJc6dwJNMOi1Ov+GoF4aT4rBYeihfYk2qrg\nBRbsRsi9NyW1Xg+jBn/JU2J7wtj0LY9/ZjftzQaDRGMjNpRoQElM9dl9yiM7\n22PFcVxygtOIz7bwWEqHJosPO73TInIDb1D1wSNyE1X42iGvlqcsx6w2xeop\nwLqdeYqMvA/ogBaFuPuLdS3bDfbBXUghT0KT0/h0O72bGCs93as2etC4XBdE\ndi++E06KI4/GNo+Kxb0QJCZct6YV0ZqEp/aIav12MsdFISaCBaUvnaVXg8ub\nwMiiWt4mX+kZnsrQ93pJJI3HGYZxC7fOZ3CgC5fC3PygkzvzVC+m1JXuwSye\n4ypZgn1TsSL1sr+ItziE6KGb59ZgJtvJyvou6AUWBdxqHtBmBhRx+hqP04bU\nhk0fOUR4HutnmYrrQbp1KH2zLPbcabAofDV6uiB5/mNmsC4rtS5TjfHQsyk6\nPUX73mRu1foRBVPMkcEcsOZckYbQiLrcK0ZLlRDLWkwDECygoU2+9FG5zCJS\n2ltGdu3sWVgihrZpH0WcXvRdzW1ltmVhc3nqstUVJ6hhstZLZ2SOQsHn8/i+\n1lDA/Ucmlcjm7Co31ch0p7tlxKI2W2tQRUtMDP/uZC0K8SQzoq1Ps80G49HA\n8vFA\r\n=+h10\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"dist/module/index.js","readme":"Cross Domain Utils\n------------------\n\nA set of utilities for dealing with cross-domain windows\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string. \n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command        | Description  |          \n| ------------- |:-------------:|\n| npm run build | Builds the dist files |\n| npm test      | Runs the test suite.  Lint + Type + Karma  |\n\n# Debugging\n\nRun the debug task and pass the next tasks as argument.\n\n```\nnpm run debug -- npm run build\nnpm run debug -- npm test\nnpm run debug -- npm run karma -- --browsers=Chrome\n```\n","gitHead":"6d9dbb20919a22b6297c037e4b9cb0e424b25f0d","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir dist/module","build":"npm run test && npm run clean && npm run babel && npm run webpack && npm run gen-flow-files","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"./publish.sh","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","release:major":"./publish.sh major","release:minor":"./publish.sh minor","release:patch":"./publish.sh patch","gen-flow-files":"gen-flow-files src --out-dir dist/module"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache 2.0"}],"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.12","description":"Javascript module template.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"zalgo-promise":"^1.0.11","gen-flow-files":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","mocha":"^4","flow-bin":"0.155.0","flow-copy-source":"^2.0.9","grumbler-scripts":"^3"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_2.0.38-beta.1_1644871457043_0.743645082332572","host":"s3://npm-registry-packages"}},"2.0.38-beta.2":{"name":"@krakenjs/cross-domain-utils","version":"2.0.38-beta.2","keywords":["template"],"_id":"@krakenjs/cross-domain-utils@2.0.38-beta.2","maintainers":[{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"cd651f3859e6fed14ac8c5cfc5a6ecfa75e3030c","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-2.0.38-beta.2.tgz","fileCount":21,"integrity":"sha512-kAs4D45lE7oD46hW2L1JdKY1Q0lhNI5vOGcWlwgIOU8lwAARRyD5dAufMVo9AEmjB6ChAqAUQl2jHivQGdHPHg==","signatures":[{"sig":"MEUCIHqTPB0sTsEBG2xpfxP3ieY7oDKVZtvTzp8G991w2v9yAiEAr1Yw03kKcsUlYwW8k6BQg+XUtWt+W/BhxOV22M5IeV0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":159172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCsH5CRA9TVsSAnZWagAADQwP/jkQjIBwWoHS/y5DhjdV\nxlZHbDHGrKn4WZAxMj++4L6bt+OzQop0rhPojRkNgef93pmpSsESXvnhCVdK\nXXomOtZWxaMDB9z3H0CmwhInwNa2qlIdtt+LmXoltWLnxlp/7vAox6DaaFiu\nIWMFoiHbggYlKL1o6/MOg5eatCPyhjEHzmsYBR0iAsV3Pw7Hb8n6iJX5YPx7\n+tvrdsgsKNnYk6lBTc1BKjztSNSXd5ECyWWyJCLT+s7PBz3L/16quhKtIdDt\n7Y1iF09DvXPufWnCyxN9Jlf5f4DlKUUVwxSdy66L2lGWtjmsufI9K92X8liQ\nyv86S/0x65asnOt+/5CrMSeqHP4nmggqmWeE2swQSUdUreP9KvuvPazHlL9W\nLg9Rm5/mou1R6enews4B5GJudBjPelszPNS2fRaIIq7smAC5VqPuOCX5v8BV\ntkXfGu3Tr9YF+LGNiP6CRP3N0FXbdmQs7pIKbb/BrPmv8RThoUdcl4veflkE\nnt/dLjKYqu0TfyHpv3/jZ65+ALlhbO4pFu+bvSQqIWdNxgryOa0X45PqIf1a\nlkwSB0FDvvrUCIaOgPHvQwZdXILaV35ntWO5p5cda7nVlgIgu0lP49L3CkC7\nLbn0KprBlQ/HTSMf/LIqEMpJpN5cP75hStfHjN9gyCqmn11wHibCBxuP4DQP\niThF\r\n=FF+r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"lib/index.js","readme":"Cross Domain Utils\n------------------\n\nA set of utilities for dealing with cross-domain windows\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string. \n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command        | Description  |          \n| ------------- |:-------------:|\n| npm run build | Builds the dist files |\n| npm test      | Runs the test suite.  Lint + Type + Karma  |\n\n# Debugging\n\nRun the debug task and pass the next tasks as argument.\n\n```\nnpm run debug -- npm run build\nnpm run debug -- npm test\nnpm run debug -- npm run karma -- --browsers=Chrome\n```\n","gitHead":"6d9dbb20919a22b6297c037e4b9cb0e424b25f0d","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir lib/","build":"npm run test && npm run clean && npm run babel && npm run webpack && npm run gen-flow-files","clean":"rimraf dist coverage lib","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"./publish.sh","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","release:major":"./publish.sh major","release:minor":"./publish.sh minor","release:patch":"./publish.sh patch","gen-flow-files":"gen-flow-files src --out-dir lib"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache 2.0"}],"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.12","description":"Javascript module template.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"zalgo-promise":"^1.0.11","gen-flow-files":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","mocha":"^4","flow-bin":"0.155.0","flow-copy-source":"^2.0.9","grumbler-scripts":"^3"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_2.0.38-beta.2_1644872185216_0.6437774574546251","host":"s3://npm-registry-packages"}},"2.0.38-beta.3":{"name":"@krakenjs/cross-domain-utils","version":"2.0.38-beta.3","keywords":["template"],"_id":"@krakenjs/cross-domain-utils@2.0.38-beta.3","maintainers":[{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"c96bdc085036c9e3804165ccec7eaea3dfd6623f","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-2.0.38-beta.3.tgz","fileCount":21,"integrity":"sha512-LFvPc00LUozMwe5jKEU+k8q0M6xSyUYGNQvtX7riw7B35BrJ5mKrLgRwqiw3g+nwTuOAkRVhSW+qWbvth4hvSw==","signatures":[{"sig":"MEQCIFiXuumV+nnU/SPLsXfzIEeCJZ2C6APCVBcnii4+CGgjAiB0qhKgoGhb6k8KrfROSJMFDANPL/KAqm34OG6BrmNFnQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":159172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCse1CRA9TVsSAnZWagAALu8P/A83DcllPrmx90O3BAoM\nLRp1ktmfdPxvQryPgrPPQFlsyM3oeSpGxx4D0EyRb/d0qZ6s1gaqcVGb73xX\nGQz6lDc+FobfUvAehzq90L+StM3TziSEGD4Bs0nUlNqxfbTaQs6Y9/RCtke6\nIggj+vlyR71eChli+BuZj0lGY4eyssP/I+9/yaom+MoqXLTHA3nJpRdZF1Zb\ntKEuhdJb37Pd0RwfxBrzisyLb0gsOrq9Nk7DOkPdaSSVAUN0uY1Aq9pjIVKB\nsxSRJJkvKy3aD0AU2P4FDCKQGcjn/WKj6rk2yUWIYESWKatfdisnJyA/o6eW\nmDMxQtK79K8h5sd2u+g1eQ5+Y+iX8L5uplGXiiE7yNSLIr9tWGb8Q3d3KFD8\ndjNpi6oH4u644QVgfOi7smtxwjHyE+6T9qdCTxApwmB8HOyFHm9b5e2e8JFA\nyk1Wf3yWCPZLLXe4r/eEzgstdakDm+5q56X361ql8f4yNZ2MrZbxnb55ZTaj\nt+aZnbf79I2G/M6dtV33PQQJ/eMGuXpQJcH/d9Az2bZRd1CMk9sACjjue7q1\nkUTNYqrvE935iZIporLB4R/T92L6i2gJsl9kKuhhP51bo5GBheST3htvXnpq\ne97DD3roHp+Sz9LOrcPG0YXShGPx1cJaMXG9qzpdI5kIA5FmqX8mrojNBcK1\n1IMA\r\n=FINn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"lib/index.js","readme":"Cross Domain Utils\n------------------\n\nA set of utilities for dealing with cross-domain windows\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string. \n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command        | Description  |          \n| ------------- |:-------------:|\n| npm run build | Builds the dist files |\n| npm test      | Runs the test suite.  Lint + Type + Karma  |\n\n# Debugging\n\nRun the debug task and pass the next tasks as argument.\n\n```\nnpm run debug -- npm run build\nnpm run debug -- npm test\nnpm run debug -- npm run karma -- --browsers=Chrome\n```\n","gitHead":"48c511f6ae2870f9bc90e08ecd466169c959b8d1","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir lib/","build":"npm run test && npm run clean && npm run babel && npm run webpack && npm run gen-flow-files","clean":"rimraf dist coverage lib","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"./publish.sh","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","release:major":"./publish.sh major","release:minor":"./publish.sh minor","release:patch":"./publish.sh patch","gen-flow-files":"gen-flow-files src --out-dir lib"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache 2.0"}],"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.12","description":"Javascript module template.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"zalgo-promise":"^1.0.11","gen-flow-files":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","mocha":"^4","flow-bin":"0.155.0","flow-copy-source":"^2.0.9","grumbler-scripts":"^3"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_2.0.38-beta.3_1644873653546_0.6396962591385071","host":"s3://npm-registry-packages"}},"2.0.38-beta.4":{"name":"@krakenjs/cross-domain-utils","version":"2.0.38-beta.4","keywords":["template"],"_id":"@krakenjs/cross-domain-utils@2.0.38-beta.4","maintainers":[{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"df68a34388383a10e624c0163bb1e41e31431f12","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-2.0.38-beta.4.tgz","fileCount":21,"integrity":"sha512-2TJcsY7RWYEXQOEmZEoKU4GJbI6IqsixpW5DDe1mc4dp/bfUHNCjoiFLL9R6XCMy9mN4YHcngh2c+J7Sknzu5g==","signatures":[{"sig":"MEYCIQDR5Oq+zzS9WsG2ApL3xW+PVAF/wNTCKLfYhtN8UmvOnwIhAJOra7wDw9ilv/nc19o3TPlxHJ716QqO/05RszWpdqUU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":159164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCuWiCRA9TVsSAnZWagAANlkP/1qiJo3THY75O2T0lueB\nniazGv0fPbE7W92dn4nQUnY6ZDqFO8qFRgqTNuah4Rl+udFCPnlxDL1TATtF\nQ8K6jIyMr27wzoPuMFB0If/n/D4m8NMj/3Bi5DoN5G1WmdpjYzqMDEZfkCy3\nFbAs9BqF2NnTaSjzmmIMTLsbt+rm7iqOsyGcBMZmtzsTXBdcfOZn1KdSXgNW\n74w2OpOk2oBZepi48UiBtXTSki4cRKV51ynx7841Vodi885kgGSzJaHh1t1M\nZbZgQeNhP91TQXIKFJNQjzOumroo8WZABbXZN34+UpKSz99xKqXqRF8ZHnUn\nIIJYOxRlBWiG/gDn/MkrsAloFm7oOsYPJPyaIPI78fIQOuic80BbA1OnwVzF\ngq0YLXDNf3xjMK9lB7C8fwN5UgFSiIWhRTXWcFppypmy8Vgw1uTpO0UOtMOE\nBXzeQahUdAnRcgV1q384De/IleHZs9Vzo4vAIYTaWCEatQGD6Loz62qJuOr8\nhcXEb0b01MNqigGSdaJ0XeFPfgyJ/6LoyN2GFR45VqMqkSgtFJ1wk0rCiIHe\nKS+8ku94ysmycwcIpQjeliIbnyMT5Mq6EJ1d+Ylu0ppqE5S2wZ+VTK57AA8E\n7Mds6HQxWkQZ9NbUI3bxm8jrIh0+WcDi3ZePdSvSwOb/TDB+tJF9vPg0FVbx\necOM\r\n=pMvx\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"lib/index.js","readme":"Cross Domain Utils\n------------------\n\nA set of utilities for dealing with cross-domain windows\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string. \n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command        | Description  |          \n| ------------- |:-------------:|\n| npm run build | Builds the dist files |\n| npm test      | Runs the test suite.  Lint + Type + Karma  |\n\n# Debugging\n\nRun the debug task and pass the next tasks as argument.\n\n```\nnpm run debug -- npm run build\nnpm run debug -- npm test\nnpm run debug -- npm run karma -- --browsers=Chrome\n```\n","gitHead":"48c511f6ae2870f9bc90e08ecd466169c959b8d1","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir lib/","build":"npm run test && npm run clean && npm run babel && npm run webpack && npm run gen-flow-files","clean":"rimraf dist coverage lib","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"./publish.sh","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","release:major":"./publish.sh major","release:minor":"./publish.sh minor","release:patch":"./publish.sh patch","gen-flow-files":"flow-copy-source src lib"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache 2.0"}],"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.12","description":"Javascript module template.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"zalgo-promise":"^1.0.11","gen-flow-files":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","mocha":"^4","flow-bin":"0.155.0","flow-copy-source":"^2.0.9","grumbler-scripts":"^3"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_2.0.38-beta.4_1644881313877_0.8177186655894368","host":"s3://npm-registry-packages"}},"2.0.38-beta.5":{"name":"@krakenjs/cross-domain-utils","version":"2.0.38-beta.5","keywords":["template"],"_id":"@krakenjs/cross-domain-utils@2.0.38-beta.5","maintainers":[{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"f19e41d075b933080eb3d62b85b5668fe553c1a2","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-2.0.38-beta.5.tgz","fileCount":21,"integrity":"sha512-COO1/PtnTVKk3/pDdQ7AB/X641ktlUdcWX+G/81Juv86Qfnwg82M19QQ0zR7vdv/6DczAAW9UrI6YCgJUO4Gbw==","signatures":[{"sig":"MEUCIQCKQqWdp5wxtWCbLIaaPgrZSXGQhfPHXLAW8WL5XG2RsgIgOUYrrPlXFGQRuWeYD7F7cSLqqy/DgiHE6OqMHVJb7KA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":177367,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCvT+CRA9TVsSAnZWagAAR84P/2LJAKIZG4Dh+0/YDTzX\nKLlNG/bvE/ug6SSQmPuEL3L3Uzi877f2Gp5GGkkDNWXSrjct3I0AfXUOrn6S\nttk2cS1p32CIxIA/oQ788lriWfa39w/L+UKcj5FesOph473j9BoJVT2L/NB5\njH6AO5Ga1lSzVi95FTMYHxKJMDj59xl8gdY7T8ycuMtic3i0abSq6E5ruuPE\n9aivJmoVorr4kr2n2roI13Z0a0EzrWBvMfKoTfcSkNlxOw7hIRC9KHYFbwuI\nfhd/MZ2toYqQXpvatvDXZfkCdHGZyM4RYxIzehDFFFA/w1n4a4W4FRoBF2Dg\nmlHeG+xL0smMbtrM9RTSWvpNajBfcQXQtcBtPGya++i6IHURlVbSJGTJmYMY\nkP79K3Xc7oo+qQBK+ZQ+/M4GetUsEy5t2rTnq6/NxFDs+FnPt1lvrHpLkQ6Y\nnRv/zzcumx1gtSw9iLamb8hmGMEgGdMfU8V/S1WsBdo3OpXt7R/jUYsO2TUx\n3lJ6TaYTELb2my7PpCKKYsW0cFFfaxCAO8xHjFKFDqB/NvqPgRJnM5NGu570\nkKGL0CbTTMYamSzXus6i87Yy7msGi8kC1/BtbtBvmdk+yG5DhKg25TI4RxVS\nncF4yqMj3MVuNywY1Y0nCGagtugSwNV3NaUoREarUpdB5QVsawHzKXIDtF1j\nC1mT\r\n=5Rvc\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"lib/index.js","readme":"Cross Domain Utils\n------------------\n\nA set of utilities for dealing with cross-domain windows\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string. \n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command        | Description  |          \n| ------------- |:-------------:|\n| npm run build | Builds the dist files |\n| npm test      | Runs the test suite.  Lint + Type + Karma  |\n\n# Debugging\n\nRun the debug task and pass the next tasks as argument.\n\n```\nnpm run debug -- npm run build\nnpm run debug -- npm test\nnpm run debug -- npm run karma -- --browsers=Chrome\n```\n","gitHead":"48c511f6ae2870f9bc90e08ecd466169c959b8d1","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir lib/","build":"npm run test && npm run clean && npm run babel && npm run webpack && npm run gen-flow-files","clean":"rimraf dist coverage lib","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"./publish.sh","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","release:major":"./publish.sh major","release:minor":"./publish.sh minor","release:patch":"./publish.sh patch","gen-flow-files":"flow-copy-source src lib"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"licenses":[{"url":"http://www.apache.org/licenses/LICENSE-2.0.html","type":"Apache 2.0"}],"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.12","description":"Javascript module template.","directories":{},"_nodeVersion":"12.22.1","dependencies":{"zalgo-promise":"^1.0.11","gen-flow-files":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","mocha":"^4","flow-bin":"0.155.0","flow-copy-source":"^2.0.9","grumbler-scripts":"^3"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_2.0.38-beta.5_1644885245966_0.44044169537241684","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@krakenjs/cross-domain-utils","version":"3.0.0","keywords":["template"],"license":"Apache-2.0","_id":"@krakenjs/cross-domain-utils@3.0.0","maintainers":[{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"c0dc704f04b2d6c006268735965ab2a67990718d","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-3.0.0.tgz","fileCount":22,"integrity":"sha512-tfdZoV4u8/Cn4ro/R3UhcVbH83+uBbmtZ8Kau09K0Vp2toelauSvJ6OlN1fnfZZCkXEV6gnA/wt39Z5h3wdecg==","signatures":[{"sig":"MEUCIDsiH2AZ4DZnh1TeELbwrwRXyBo9S8+pL3knaCRZrR6cAiEA768yUZkocjwMG3LsaCGw52fxH2NzWOtyARiNf/VpWO8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDFs/CRA9TVsSAnZWagAA27kP/24Lq9VjBEya8ad5PRN1\n2rgtQlPxQyplJUXXr4394xSZ3fN9CfwblMqQxDYnIVgiV/gMctlcXIDmAcLC\n6Tw4hGVvTC+8Ov9zFenQ4EY4k2Bk2BtPMqv8P9PVC99eHDhJnO4mLG51GinI\nvEcAEfqAQpi11AZoqcrvOIugEpMDLqr2p7vEZiTPHcK68m0mdeO6L4qm/Rzo\nq+C8JRTpTJun5kjxwIS6d76bChjaeBCvuUgOuF3WI4oh7nZaOMs2inZ65JK1\nu1KE6MQ7xYpfRMIjy/piE3jKEdpRDTg/dMr7r4zLJDejZ7TeJtDYtG92PKZX\n5kNNI2cseWOmQTPEm0ar8Uyhdh7snThbDZLDbX9E9sEDmM24BwPl3dbt5P2/\nNDITf9G9Lu9TOKxZTegEBSxLZrQcAOp58GM0XvSqkzwizcHOZHZUga8bosiN\nTu8fl707iU+OEPXEP2giv0V0aqHPWY9y90yHb4afvyKd9l7EDs3x9VR3LooQ\nFzB14ELUL1QznlK5AiI/MaWRbTFDavhJ+sJ6TIwCX6fzC52Io4ee2pG9lbi/\nLIF2njCBP87qSHd9FDPCLTWp0S8DAuSK5FUPDj4J5yVvff7+M/3N7HHgPNHT\nerVao1Q1HMtlMqKLe5mHUZXBuBQKguYU/7ovLqcVY7iyeODHSSxNFGB8KElX\nMFdV\r\n=8GYI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"dist/module/index.js","gitHead":"c1e2b3e351e6a5a05480d7908f49743712d2438d","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir dist/module","build":"npm run babel && npm run webpack","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"standard-version","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","prerelease":"npm run clean && npm run test && npm run build","postpublish":"pinst --enable","postrelease":"git push && git push --follow-tags && npm publish","_postinstall":"husky install","prepublishOnly":"pinst --disable"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.12","description":"Javascript module template.","directories":{},"_nodeVersion":"12.22.1","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","husky":"^7.0.4","mocha":"^4","pinst":"^2.1.6","flow-bin":"0.155.0","@commitlint/cli":"^16.2.1","grumbler-scripts":"^3","standard-version":"^9.3.2","@commitlint/config-conventional":"^16.2.1"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_3.0.0_1644976959028_0.40838149019669534","host":"s3://npm-registry-packages"}},"3.0.1":{"name":"@krakenjs/cross-domain-utils","version":"3.0.1","keywords":["template"],"license":"Apache-2.0","_id":"@krakenjs/cross-domain-utils@3.0.1","maintainers":[{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"0cf7e37afeaa52fd0d418317eb4e9558c6591a0d","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-3.0.1.tgz","fileCount":22,"integrity":"sha512-xyzeaOB3vhoA3jjvb0FC+RTuNsJ3R655yvfrgmCihgsanbl1tw2wYF7nYMBTTa11Fx08nKx4t8A9RuH6xn5lAg==","signatures":[{"sig":"MEUCIQDkxjnCq69okM0qjZ5nbettH+wcSITYda05R1Bi2cavFwIgYb/kT0nAVBso6vjT8if7aT7srDzeY70S852XFAXceXI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":200555,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDGEvCRA9TVsSAnZWagAAmM0P/0sboiV1tM2lLi5kcqn2\nRNo0UeF0xgSPEnQfeh9Sol+jiVspgUttZx0co/aS469qxwlKo3JpEwl5s9oi\nmbnpRzMC7NPuHMvBn+w4ELlsKGthWdDTAYjSlkzfAmqQHx3aV9J5ArJQQeAK\nrlRp6jWBZcun0RA6UnQiFisTuvcpGumPIYacov/CdfQOBWcb7pkKUfMnDWR4\nVP0cR/y72MvPyDF942PJ4v3/vMk0JJrEDBd90eyMVhf4TdsLr6rgT5nPE/2O\nxyGD4BXbLZisdfvwjfejaZtm9qMZhl6cVxB7Ii9dK9JjfaipXvWhQjLUaNxL\nX2YM9CVCdhgALcCJW/7PUbwj6j+W8kxUY4sMHNbdfQZkvv3kx4DvntNYQpA5\n9ykNZtjw22tM1t50qH+Xb5reVsjGKK2PcTLdEoWkAO4m4qksXXq1RR7kKWHn\nKZIU6tQEZcsF611nDPSkq5L0pT0WlmUY421YtVxuWWZ1imkD7jzR+lcdPMVD\n+n2VEVAqwelItdoBO+gUXOfuEVXG4wOvswhc4kO4sHRdxwBdyH98LDc5wYGQ\nt4Q323k7Qpa1IWu3N94uS7FT9nOkw2+lbCYmNuOGySAeNnKU433UQJB+abY/\n5eAkjzW0STEx4hTqbHv/OqHrJFWIM2GGEv/8tFCw0UU4qw+ad7gZjIn+6e4a\nKyMm\r\n=HkCD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"dist/module/index.js","gitHead":"c1e2b3e351e6a5a05480d7908f49743712d2438d","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir dist/module","build":"npm run babel && npm run webpack","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"standard-version","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","prerelease":"npm run clean && npm run test && npm run build","postpublish":"pinst --enable","postrelease":"git push && git push --follow-tags && npm publish","_postinstall":"husky install","prepublishOnly":"pinst --disable"},"_npmUser":{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.12","description":"Javascript module template.","directories":{},"_nodeVersion":"12.22.1","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","husky":"^7.0.4","mocha":"^4","pinst":"^2.1.6","flow-bin":"0.155.0","@commitlint/cli":"^16.2.1","grumbler-scripts":"^3","standard-version":"^9.3.2","@commitlint/config-conventional":"^16.2.1"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_3.0.1_1644978479425_0.885228480559014","host":"s3://npm-registry-packages"}},"3.0.2":{"name":"@krakenjs/cross-domain-utils","version":"3.0.2","keywords":["template"],"license":"Apache-2.0","_id":"@krakenjs/cross-domain-utils@3.0.2","maintainers":[{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"cbbd3323e65e831debc351549c0b8972df0382d5","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-3.0.2.tgz","fileCount":17,"integrity":"sha512-uNTQrAevzKtOu13UZzamCR6rKX2vpdb6g/gVXMJVSMvAlYhxBN6mOD6U56DmSdBJDKvLSYZbIYUkBh2inDyIXQ==","signatures":[{"sig":"MEUCICky26ETDw2h5ztOo0zE3gHuGgo1Ry2lsPbYqVAFLjcnAiEAqnUSjMOMvz0tZPgF5Hdj2hR3wFdlAq/TDhmGMOEMLpE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":152484,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDGS9CRA9TVsSAnZWagAAaKsP/37Zh9t69kJdbYIVOCMq\nBhVxOfdGLNb996zSt+j5JsJg6GX8MXUDQwuZ33IpA4byh7jiYnzeY2UK8+NS\nk/cY2/Uec6x0rcnmKVwZuk5ookvxAQIU+PuwnCg8HeKjsNPR3JTib2WowSMq\nIagxMKKW2vm6RofOWeTQpi3vCrGVctliZvL6fWIbJYR5M4T8svrhYO/Yb3D9\n8gBKWCxA1nQLlTwAUMTPi2oQDtfKGb3bB5X0cYHHb5IGb7fz/tQNhN2Pc0CF\njU1Av117QfZu941deS9NNqKSWTW/zRmkogUXFZIa/o/xFzyvVGU4tBwpI1Dg\neAzVasdOA0e73Oq1YTE1JiOo/G6rJir8A/kQfdJX2MJ32sATkOb3UBEgHeO/\n86rRQWZ5GHq98y96IG3VvM4Jh0QgeS0KrdYMOiGwMr5lA4nrh4CiwVrR0pJX\nqmIbACO/ulC1bIchvnIvrVORH/AfN90pz5vk/kI7W3EMB1fdJuLmTjkF7VhO\nDez+GVr9SFvmtrK0oinGth6OKwNq26gqmWdgR77KsiF1jd1nYoBdH6AzhJgP\noihV0cGkWkePnuA6mP21TMUk9+ycOWZawiSHXH2/zpP5Ni6M9UI5220mr8dO\n1kaVINWI/TwcVjCHXtRlu6R0ucLpbqjjmA01TwCLgQw3w/mEp/9BcUtGalcJ\nOBYl\r\n=rc4H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","module":"dist/module/index.js","gitHead":"9d6fe6c3eada3efee73fe578437b10165de5c7ac","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir dist/module","build":"npm run babel && npm run webpack","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","release":"standard-version","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","prerelease":"npm run clean && npm run test && npm run build","postpublish":"pinst --enable","postrelease":"git push && git push --follow-tags && npm publish","_postinstall":"husky install","prepublishOnly":"pinst --disable"},"_npmUser":{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.16","description":"Javascript module template.","directories":{},"_nodeVersion":"14.19.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","husky":"^7.0.4","mocha":"^4","pinst":"^2.1.6","flow-bin":"0.155.0","@commitlint/cli":"^16.2.1","grumbler-scripts":"^3","standard-version":"^9.3.2","@commitlint/config-conventional":"^16.2.1"},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_3.0.2_1644979389744_0.9840088655338723","host":"s3://npm-registry-packages"}},"4.0.0-alpha.1":{"name":"@krakenjs/cross-domain-utils","version":"4.0.0-alpha.1","keywords":["template"],"license":"Apache-2.0","_id":"@krakenjs/cross-domain-utils@4.0.0-alpha.1","maintainers":[{"name":"gregjopa","email":"grjopa@gmail.com"},{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"9b8281a6ff8ae553948307bab7413ad88c0cb8ee","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-4.0.0-alpha.1.tgz","fileCount":26,"integrity":"sha512-nxaWxAwT4I+lqxyRK5xt6D/R4EREuiaUF7BgKokXrCO0Zj4ob+YwAWEp1etAiIhmH9jCbJOYsnQH6Mg3pxVwiA==","signatures":[{"sig":"MEUCIQCi6V1dXcha159nLMsH/95X18e3FUrXV3FcAO8Z82CU2QIgdUq5vLLXfLmN3Tncqu0+WlD9XZDLzYwRCUYLv5CYPMg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":166154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiu8LnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTfw//cVftDtIp2qU8PyB8LUpDBnua/pai2cZmAmabtfGGfxk1N9+K\r\n6Zv80s4+HLiv1x2rvPZrCASCk5DOmsXOj6JWbmf/sKZ17EHjHyEoAp8Vx6hY\r\n2y/OTxrACxrgmWxGIaUOSs+jaq0CPzE4JsQQYXIv1SrWqyMn1/megtfAzs6U\r\nzb/jUG2dvfOUJYj1HeICHjC2N3LX5Ng1US8dZeolN+XPrew9EPrYV0QAtta9\r\nwUDuphlK7zRuOxeLzDrSzReN4xJ7MqWK2ePjCXYcG0knOiIi2Z108E5Qpexm\r\nyMw6yux/8GCTOkZAecQmBbSMFxkhP9858d6WiW48sEjkly6BWHerg+qHCcY/\r\nBxPUN+pY4E/qt1IZ4pzNKsrgYELiZ3LRket+tAe+4XDcQ07PkV0u8vWGCFjF\r\nSfKISphOUvxcv2Jv8yXOH+k/swKL+yzRfZoYMT4OuFS+hIAdcs5Yfb+aR4mB\r\nqOfAeMP/s6dtWi2tfNWlMNaOwG/oG6k88WkDoP/wGfDuIOJvowE3aWfubLnN\r\nYGlMc1+ttoFS3WTtBGRbuc8U2akhDYCJ55hGcthTE5DVwMhEYskAnnH5GCh0\r\n5ryru0F9ooXytGp08VGhK+jMX9NJoVHY8BQmry8dyXPVltixTu7jX5ZqOt99\r\nMmEMA8laNkQ2fu/A4moeaCw0g/jZCl5Z/xk=\r\n=lDFO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","types":"dist/types/index.d.ts","module":"lib/index.js","readme":"## Cross Domain Utils\n\n[![build status][build-badge]][build]\n[![code coverage][coverage-badge]][coverage]\n[![npm version][version-badge]][package]\n[![apache license][license-badge]][license]\n\n[build-badge]: https://img.shields.io/github/workflow/status/krakenjs/cross-domain-utils/build?logo=github&style=flat-square\n[build]: https://github.com/krakenjs/cross-domain-utils/actions/workflows/main.yml?query=workflow:build\n[coverage-badge]: https://img.shields.io/codecov/c/github/krakenjs/cross-domain-utils.svg?style=flat-square\n[coverage]: https://codecov.io/github/krakenjs/cross-domain-utils\n[version-badge]: https://img.shields.io/npm/v/@krakenjs/cross-domain-utils.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@krakenjs/cross-domain-utils\n[license-badge]: https://img.shields.io/npm/l/@krakenjs/cross-domain-utils.svg?style=flat-square\n[license]: https://github.com/krakenjs/cross-domain-utils/blob/main/LICENSE\n\nA set of utilities for dealing with cross-domain windows\n\n## Installation\n\nAs of version 3 this package will be published under the `@krakenjs` scope.\n\n```\nnpm install @krakenjs/cross-domain-utils\n```\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string.\n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command       |               Description                |\n| ------------- | :--------------------------------------: |\n| npm run build |          Builds the dist files           |\n| npm test      | Runs the test suite. Lint + Type + Karma |\n\n# Debugging\n\nRun the debug task and pass the next tasks as argument.\n\n```\nnpm run debug -- npm run build\nnpm run debug -- npm test\nnpm run debug -- npm run karma -- --browsers=Chrome\n```\n","exports":{".":{"import":"./dist/my-component-lib.es.js","require":"./dist/my-component-lib.umd.js"}},"gitHead":"ce84dbc20a53a1e5386f648fb0af0ddcf9fa30f3","scripts":{"tsc":"tsc","lint":"eslint --ext ts,tsx,js,jsx src/ test/","test":"npm run format:check && npm run lint && npm run tsc --no-emit && npm run vitest","babel":"cross-env NODE_ENV=production babel src/ --out-dir ./dist/esm/ --extensions .ts,.tsx","build":"npm run test && npm run babel && npm run webpack && npm run build:types","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","format":"prettier --write --ignore-unknown .","vitest":"vitest run --dom --coverage","prepare":"husky install","release":"standard-version","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","build:tsc":"tsc src/* --outDir ./dist/esm --declaration --emitDeclarationOnly","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","build:flow":"find ./dist -type f -not -path './node_modules/*' -name '*.d.ts' -exec sh -c 'flowgen --add-flow-header $1 -o ${1%.*.*}.js.flow' _ '{}' \\;","prerelease":"npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'","build:types":"npm run build:tsc && npm run build:flow","postrelease":"git push && git push --follow-tags && npm publish","format:check":"prettier --check .","vitest:watch":"vitest watch --dom --coverage --ui"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"8.13.1","description":"Utilities for dealing with cross-domain windows.","directories":{},"lint-staged":{"**/*":"prettier --write --ignore-unknown"},"_nodeVersion":"16.14.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"^7.11.0","husky":"^7.0.4","mocha":"^4","vitest":"0.16.0","flowgen":"^1.16.0","ts-node":"^10.5.0","prettier":"2.7.1","happy-dom":"^2.55.0","@vitest/ui":"^0.16.0","typescript":"4.6.3","lint-staged":"^13.0.3","@types/webpack":"^5.28.0","@commitlint/cli":"^16.2.1","standard-version":"^9.3.2","@typescript-eslint/parser":"^5.20.0","@krakenjs/grumbler-scripts":"^7.0.3","@commitlint/config-conventional":"^16.2.1","@typescript-eslint/eslint-plugin":"^5.20.0"},"standard-version":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","hidden":false},{"type":"docs","hidden":false},{"type":"style","hidden":false},{"type":"refactor","hidden":false},{"type":"perf","hidden":false},{"type":"test","hidden":false},{"type":"ci","hidden":true}]},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_4.0.0-alpha.1_1656472295375_0.772009179138863","host":"s3://npm-registry-packages"}},"4.0.0-alpha.2":{"name":"@krakenjs/cross-domain-utils","version":"4.0.0-alpha.2","keywords":["template"],"license":"Apache-2.0","_id":"@krakenjs/cross-domain-utils@4.0.0-alpha.2","maintainers":[{"name":"gregjopa","email":"grjopa@gmail.com"},{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"9e956895df684f75af59527bd45e7bda6cc7735b","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-4.0.0-alpha.2.tgz","fileCount":32,"integrity":"sha512-2YMarqcshSnew/t7ruKFG0UPVcIJjAIki6SyF7o5SvSePUGRNNXSAtSIezSHH5PRCqd3hv6O7H1TJspwcGw0VA==","signatures":[{"sig":"MEUCIQCYAo4SFrPYtznDvoZWhWu8UAx0sssS4RkPKWKXJpCbCgIgI+q0XznzBH451BItfhXdAt8mpxsFoDkljlfx3aUJ6to=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":210606,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivO+rACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoySQ//bRWD5R72kAlntR5D49se5/gba8rWpbhLN+iycY8TE/Qi4NLh\r\nedMeru+59G3xWDXiOhPabYQW72emRrzgkvVA80W6umqRPddWD4E3cheVgbnc\r\nyvmA/WsdviS/kY2YoH4awgrjIivQltk50lv1+zwbwufo48+1OkBGb6xwKkiY\r\n5Bn52eU/fUiI55ZQI6SqoeKW+/ZuF/gstT5oabpIJ5Qjj9J0N59lOlFLmRin\r\nAQHsnRrAVrmcOYAIphhY3iWNfIMDwLPdiICEhggXzye5aEb/hSdTTewgDlSi\r\nehVk5J8DQFQx+ejqwNGn/BwGnLoOYzh5XYdG9mAZjhGBHVQ1buQc9z9lEDYV\r\nnBB8WD42qkg+Pcb8O4cdJ0W/doICiD6TcU68qRc27bQUH9zYy3wmRNDknzqN\r\ng1V2H5hm3eclWEZCppMfl2/79atwV5VTNKEQMYw84N8PT2oupbaUZou1Tnyr\r\nFZFMX+0jF4e07dX6aJfFoIfONCIrTFadIBzIl1Dtx4T7K4vTk5r+ABcGBDF1\r\nAjGCiO4Q65ySmioniujutmEpkkvSkD7OErW/J+FpdXr+v20OFmLNeFaIm6UZ\r\n59H78e4PSJCqdstuOMNxC8J+ohNpeRzGhJHsSI9THXkCFMTMIgt9j4HRztay\r\npBBSzS78yqScgqBAJXXHh1EufTsc8IBdZ6Y=\r\n=HSw1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","types":"dist/types/index.d.ts","module":"dist/index.js","readme":"## Cross Domain Utils\n\n[![build status][build-badge]][build]\n[![code coverage][coverage-badge]][coverage]\n[![npm version][version-badge]][package]\n[![apache license][license-badge]][license]\n\n[build-badge]: https://img.shields.io/github/workflow/status/krakenjs/cross-domain-utils/build?logo=github&style=flat-square\n[build]: https://github.com/krakenjs/cross-domain-utils/actions/workflows/main.yml?query=workflow:build\n[coverage-badge]: https://img.shields.io/codecov/c/github/krakenjs/cross-domain-utils.svg?style=flat-square\n[coverage]: https://codecov.io/github/krakenjs/cross-domain-utils\n[version-badge]: https://img.shields.io/npm/v/@krakenjs/cross-domain-utils.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@krakenjs/cross-domain-utils\n[license-badge]: https://img.shields.io/npm/l/@krakenjs/cross-domain-utils.svg?style=flat-square\n[license]: https://github.com/krakenjs/cross-domain-utils/blob/main/LICENSE\n\nA set of utilities for dealing with cross-domain windows\n\n## Installation\n\nAs of version 3 this package will be published under the `@krakenjs` scope.\n\n```\nnpm install @krakenjs/cross-domain-utils\n```\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string.\n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command       |      Description      |\n| ------------- | :-------------------: |\n| npm run build | Builds the dist files |\n| npm test      | Runs full test suite. |\n","gitHead":"d752c9d47898588a38ce098961d2dc944f00475d","scripts":{"tsc":"tsc","lint":"eslint --ext ts,tsx,js,jsx src/ test/","test":"npm run format:check && npm run lint && npm run tsc --no-emit && npm run vitest","babel":"cross-env NODE_ENV=production babel src/ --out-dir ./dist/esm/ --extensions .ts,.tsx","build":"npm run test && npm run babel && npm run webpack && npm run build:types","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","format":"prettier --write --ignore-unknown .","vitest":"vitest run --dom --coverage","prepare":"husky install","release":"standard-version","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","build:tsc":"tsc src/* --outDir ./dist/esm --declaration --emitDeclarationOnly","build:flow":"find ./dist -type f -not -path './node_modules/*' -name '*.d.ts' -exec sh -c 'flowgen --add-flow-header $1 -o ${1%.*.*}.js.flow' _ '{}' \\;","prerelease":"npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'","build:types":"npm run build:tsc && npm run build:flow","postrelease":"git push && git push --follow-tags && npm publish","format:check":"prettier --check .","vitest:watch":"vitest watch --dom --coverage --ui"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.17","description":"Utilities for dealing with cross-domain windows.","directories":{},"lint-staged":{"**/*":"prettier --write --ignore-unknown"},"sideEffects":false,"_nodeVersion":"14.19.3","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"c8":"^7.11.0","husky":"^7.0.4","vitest":"0.16.0","flowgen":"^1.16.0","ts-node":"^10.5.0","prettier":"2.7.1","happy-dom":"^2.55.0","@vitest/ui":"^0.16.0","typescript":"4.6.3","lint-staged":"^13.0.3","@types/webpack":"^5.28.0","@commitlint/cli":"^16.2.1","standard-version":"^9.3.2","@typescript-eslint/parser":"^5.20.0","@krakenjs/grumbler-scripts":"^7.0.3","@commitlint/config-conventional":"^16.2.1","@typescript-eslint/eslint-plugin":"^5.20.0"},"standard-version":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","hidden":false},{"type":"docs","hidden":false},{"type":"style","hidden":false},{"type":"refactor","hidden":false},{"type":"perf","hidden":false},{"type":"test","hidden":false},{"type":"ci","hidden":true}]},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_4.0.0-alpha.2_1656549291036_0.34227089144675715","host":"s3://npm-registry-packages"}},"4.0.0-typescript.1":{"name":"@krakenjs/cross-domain-utils","version":"4.0.0-typescript.1","keywords":["template"],"license":"Apache-2.0","_id":"@krakenjs/cross-domain-utils@4.0.0-typescript.1","maintainers":[{"name":"gregjopa","email":"grjopa@gmail.com"},{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"9e072fef4d11cc233c84c26c0678d2e4e611d397","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-4.0.0-typescript.1.tgz","fileCount":30,"integrity":"sha512-xwYyW6oXbNpyLC7NeW2gCKa46GNsU0QHszXOO517eY9cZ+RW+jBVEsqJ7hg5CziARAkAy6ZCiudy+Yw7niz8yw==","signatures":[{"sig":"MEYCIQCyUv1hY78I9gJXZcaKGl/W9DECxbJsM4/nRPDZMUfqsQIhALWojygKZPKd9ZDh08u0CYZXvuVXIRfkXd+965OOtpzq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":210999,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfT5OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpd4hAAoLZl8l1G3q/FOIlNyLNw/MVJuEDyS3x2LV7IS9wY2wEk1Pv5\r\nloDE94pn1yNd7lQ/OPtE4sIv41M2wv7B9B4dYuBCEttBhBww2AucD0zpCgF3\r\nLv/W8lwImk8Aj0Ukf8oz7oFjVDqHM0uGuvHs3Vs3ETeIEihIOk3upW0MzbSY\r\n4QPg+iSSAFVuthKSuHS6xtKOzKOD+1dak3xVS4YuFX3Vhbs9gOXSsYNviViO\r\nHf/j44Cn8njyrS+2iD7kEPxCPqDjpSp0ebpe030zQkOx6MN8FF1eOuZ/hmfz\r\nqn2YUxNYIzQbeuSh6nrco6IPzl0UJJyv2gM7Rnq2kbP9G73XvZWKaHU1MBZR\r\nxLhTnkMeWKvkIIkyv/C3Vk2jHcZez8phfhvq7UVGkHMLdM7L10x3V/uwddW0\r\nrg45w7yBqre6pgTygPl3BebSuhOzjwhoKt43Zdhsbg1rGibS5mWdXnnXFSuT\r\nnU5VdjQ4XycOU+rzH8psJBFEH4dKL1DaGmQuL7VvpojvrGd78VQ3QgP1hwwK\r\nsvBII/CbxoNkPtywKsn8L2sqaTgu1ng1+i/njlFBVnkpEBublNyzEKNgFhQ9\r\ne97USMIihY4TVrxqyL+SbHTaGs4zQd8xFWh+JuQBxgzl4dqTZGQz1esdBS/t\r\nvQLWta+zlUnDnZGrIBijC2iSd8GfBsol71g=\r\n=AW2L\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","types":"dist/esm/index.d.ts","module":"dist/index.js","readme":"## Cross Domain Utils\n\n[![build status][build-badge]][build]\n[![code coverage][coverage-badge]][coverage]\n[![npm version][version-badge]][package]\n[![apache license][license-badge]][license]\n\n[build-badge]: https://img.shields.io/github/workflow/status/krakenjs/cross-domain-utils/build?logo=github&style=flat-square\n[build]: https://github.com/krakenjs/cross-domain-utils/actions/workflows/main.yml?query=workflow:build\n[coverage-badge]: https://img.shields.io/codecov/c/github/krakenjs/cross-domain-utils.svg?style=flat-square\n[coverage]: https://codecov.io/github/krakenjs/cross-domain-utils\n[version-badge]: https://img.shields.io/npm/v/@krakenjs/cross-domain-utils.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@krakenjs/cross-domain-utils\n[license-badge]: https://img.shields.io/npm/l/@krakenjs/cross-domain-utils.svg?style=flat-square\n[license]: https://github.com/krakenjs/cross-domain-utils/blob/main/LICENSE\n\nA set of utilities for dealing with cross-domain windows\n\n## Installation\n\nAs of version 3 this package will be published under the `@krakenjs` scope.\n\n```\nnpm install @krakenjs/cross-domain-utils\n```\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string.\n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command       |      Description      |\n| ------------- | :-------------------: |\n| npm run build | Builds the dist files |\n| npm test      | Runs full test suite. |\n","gitHead":"74e861f9761041be507071fdb3594b46d8c68d1d","scripts":{"tsc":"tsc","lint":"eslint --ext ts,tsx,js,jsx src/ test/","test":"npm run format:check && npm run lint && npm run tsc --no-emit && npm run vitest","babel":"cross-env NODE_ENV=production babel src/ --out-dir ./dist/esm/ --extensions .ts,.tsx","build":"npm run test && npm run babel && npm run webpack && npm run build:types","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","format":"prettier --write --ignore-unknown .","vitest":"vitest run --dom --coverage","prepare":"husky install","release":"standard-version","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","build:tsc":"tsc src/* --outDir ./dist/esm --declaration --emitDeclarationOnly --strict","build:flow":"find ./dist -type f -not -path './node_modules/*' -name '*.d.ts' -exec sh -c 'flowgen --add-flow-header $1 -o ${1%.*.*}.js.flow' _ '{}' \\;","prerelease":"npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'","build:types":"npm run build:tsc && npm run build:flow","postrelease":"git push && git push --follow-tags && npm publish","format:check":"prettier --check .","vitest:watch":"vitest watch --dom --coverage --ui"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"8.15.0","description":"Utilities for dealing with cross-domain windows.","directories":{},"lint-staged":{"**/*":"prettier --write --ignore-unknown"},"sideEffects":false,"_nodeVersion":"16.17.0","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.3.7","vite":"^3.2.4","husky":"^8.0.2","vitest":"0.25.3","flowgen":"^1.20.1","ts-node":"^10.9.1","prettier":"2.7.1","cross-env":"^7.0.3","happy-dom":"^7.7.0","@vitest/ui":"^0.25.3","typescript":"4.9.3","lint-staged":"^13.0.3","@commitlint/cli":"^17.3.0","standard-version":"^9.5.0","@vitest/coverage-c8":"^0.25.3","@commitlint/config-conventional":"^17.3.0","@krakenjs/babel-config-grumbler":"^8.0.7","@krakenjs/eslint-config-grumbler":"^8.0.7","@krakenjs/webpack-config-grumbler":"^8.1.0-alpha.1","@krakenjs/typescript-config-grumbler":"^8.0.7"},"standard-version":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","hidden":false},{"type":"docs","hidden":false},{"type":"style","hidden":false},{"type":"refactor","hidden":false},{"type":"perf","hidden":false},{"type":"test","hidden":false},{"type":"ci","hidden":true}]},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_4.0.0-typescript.1_1669152334464_0.3705775945896099","host":"s3://npm-registry-packages"}},"4.0.0-typescript.2":{"name":"@krakenjs/cross-domain-utils","version":"4.0.0-typescript.2","keywords":["template"],"license":"Apache-2.0","_id":"@krakenjs/cross-domain-utils@4.0.0-typescript.2","maintainers":[{"name":"gregjopa","email":"grjopa@gmail.com"},{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"daa6c85c7f503297fb380ae5320e93dbd2311d2a","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-4.0.0-typescript.2.tgz","fileCount":30,"integrity":"sha512-dc406+TlNmQmOXta1BNs8OMMho8hsXwhLBoHkjlkCDSbD/yzj78DMH9FdOhD7VUWUFqv6svPXsUUuEmfLLG7EA==","signatures":[{"sig":"MEYCIQDQ2TIbgnP0a+rE5RsMb6sxBkcbyzml8mc6+ldgNgXPRgIhALRUdD2rz+ewVxdpb38QKJcwrYnXdI66MBkQxUbTNzxC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":208179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCJ++ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZ5w/8D/XNPUZ7HZQKzYcDFbRj0saWfT4C7u6mB8nBaLifSvjQ5nIE\r\nk/Kr2YIKLIT9AZgldVGT5AWlimvY0X/mOTdMCEhmF0RVWWukGHQA8ad56Tf7\r\nwnag9U5AhtBPVExXDlcaRcFZW/KCQvcxXaYbaqTXyARM5sJfe0mbq2MkeBFG\r\n3f2gaRoPOrzgdl6tu8lOCtnh32QG43vPNWqfimIHYgl9mi9NKfmdNZ3H9fRQ\r\nqhwO52GULZ/BROd6ZXd0zvuq4GPM+OJbEZpdoYGUgx9JuWCBTT6NOKxIVPiK\r\nsPvY2qSxs0k7tUG2jO70G8ICm/dCWgQt9wzsclFi04sj29EyA+VgnvmG9lyA\r\nH1xX8FZU/sbP8PlZFvCgfosZ0a9MwzLY6aDxUfcgZeI2XNbEk22S9ngu4pQN\r\nR2eiPxHBImb2t6Dl8N7lzOnWLXwGkJV/kkuDE08QNfAi1FIAgHZtNYSac0sq\r\ndu8T8/fRwcTIAkMPVctUc0H5hlWD5HyAhgMcNHqq+bkMKs2TAawWLOheWOCH\r\n48wHJ8TJoGJrVkZ75yehxAGpXgQGniKGI7z163+c9EJiguXs2HninMX1TSq2\r\nr5Hv5JwiHvhlY84JdGHydFvP5iqu3M2U3DLNleqolslP/P16dh33ECW4vAmL\r\nwVvqcjLtt1IINWDiioZdMFCPiOckMgPM1mI=\r\n=nseK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cross-domain-utils.js","types":"dist/esm/index.d.ts","module":"dist/index.js","readme":"## Cross Domain Utils\n\n[![build status][build-badge]][build]\n[![code coverage][coverage-badge]][coverage]\n[![npm version][version-badge]][package]\n[![apache license][license-badge]][license]\n\n[build-badge]: https://img.shields.io/github/actions/workflow/status/krakenjs/cross-domain-utils/main.yml?branch=main&logo=github&style=flat-square\n[build]: https://github.com/krakenjs/cross-domain-utils/actions/workflows/main.yml?query=workflow:build\n[coverage-badge]: https://img.shields.io/codecov/c/github/krakenjs/cross-domain-utils.svg?style=flat-square\n[coverage]: https://codecov.io/github/krakenjs/cross-domain-utils\n[version-badge]: https://img.shields.io/npm/v/@krakenjs/cross-domain-utils.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@krakenjs/cross-domain-utils\n[license-badge]: https://img.shields.io/npm/l/@krakenjs/cross-domain-utils.svg?style=flat-square\n[license]: https://github.com/krakenjs/cross-domain-utils/blob/main/LICENSE\n\nA set of utilities for dealing with cross-domain windows\n\n## Installation\n\nAs of version 3 this package will be published under the `@krakenjs` scope.\n\n```\nnpm install @krakenjs/cross-domain-utils\n```\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string.\n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command       |      Description      |\n| ------------- | :-------------------: |\n| npm run build | Builds the dist files |\n| npm test      | Runs full test suite. |\n","gitHead":"0b06abfbb20f7c5ef7686b7b056690c7fb7ec226","scripts":{"tsc":"tsc","lint":"eslint --ext ts,tsx,js,jsx src/ test/","test":"npm run format:check && npm run lint && npm run tsc --no-emit && npm run vitest","babel":"cross-env NODE_ENV=production babel src/ --out-dir ./dist/esm/ --extensions .ts,.tsx","build":"npm run test && npm run babel && npm run webpack && npm run build:types","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","format":"prettier --write --ignore-unknown .","vitest":"vitest run --dom --coverage","prepare":"husky install","release":"standard-version","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","build:tsc":"tsc src/* --outDir ./dist/esm --declaration --emitDeclarationOnly --strict","build:flow":"find ./dist -type f -not -path './node_modules/*' -name '*.d.ts' -exec sh -c 'flowgen --add-flow-header $1 -o ${1%.*.*}.js.flow' _ '{}' \\;","prerelease":"npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'","build:types":"npm run build:tsc && npm run build:flow","postrelease":"git push && git push --follow-tags && npm publish","format:check":"prettier --check .","vitest:watch":"vitest watch --dom --coverage --ui"},"_npmUser":{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"8.19.2","description":"Utilities for dealing with cross-domain windows.","directories":{},"lint-staged":{"**/*":"prettier --write --ignore-unknown"},"sideEffects":false,"_nodeVersion":"16.18.1","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.3.7","vite":"^3.2.4","husky":"^8.0.2","vitest":"0.25.3","flowgen":"^1.20.1","ts-node":"^10.9.1","prettier":"2.7.1","cross-env":"^7.0.3","happy-dom":"^7.7.0","@vitest/ui":"^0.25.3","typescript":"4.9.5","lint-staged":"^13.0.3","@commitlint/cli":"^17.3.0","standard-version":"^9.5.0","@vitest/coverage-c8":"^0.25.3","@commitlint/config-conventional":"^17.3.0","@krakenjs/babel-config-grumbler":"^8.0.7","@krakenjs/eslint-config-grumbler":"^8.0.7","@krakenjs/webpack-config-grumbler":"^8.1.0-alpha.1","@krakenjs/typescript-config-grumbler":"^8.0.7"},"standard-version":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","hidden":false},{"type":"docs","hidden":false},{"type":"style","hidden":false},{"type":"refactor","hidden":false},{"type":"perf","hidden":false},{"type":"test","hidden":false},{"type":"ci","hidden":true}]},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_4.0.0-typescript.2_1678286782377_0.5435758311197201","host":"s3://npm-registry-packages"}},"3.1.0":{"name":"@krakenjs/cross-domain-utils","version":"3.1.0","keywords":["template"],"license":"Apache-2.0","_id":"@krakenjs/cross-domain-utils@3.1.0","maintainers":[{"name":"dustijones","email":"dustijones@paypal.com"},{"name":"gregjopa","email":"grjopa@gmail.com"},{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},{"name":"wsbrunson","email":"brunson.ws@gmail.com"},{"name":"westeezy","email":"westin.wrzesinski@gmail.com"},{"name":"mstuart","email":"stuartmark@gmail.com"},{"name":"sioked","email":"sioked@gmail.com"}],"homepage":"https://github.com/krakenjs/cross-domain-utils#readme","bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"dist":{"shasum":"c4863099acf36f05941345de1381ada1e207315c","tarball":"https://registry.npmjs.org/@krakenjs/cross-domain-utils/-/cross-domain-utils-3.1.0.tgz","fileCount":19,"integrity":"sha512-if+mVTg56ZyLt8wn3ZbTw0IzNjbQvvj5X7lfcBlVfYdZ93TXgHa6Rt9nqdm1rZmvqb8Ct6L29Bp7SNC3xzLfUw==","signatures":[{"sig":"MEYCIQDhBJH3xBFtN6gS0a4ZcRWG4AERLpfug8pmF9kFdBB3bwIhANgs0AhdEOR6/WucuHf/gpxYJOKGZlx2se5P0KpRM0HB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":151498},"main":"dist/cross-domain-utils.js","module":"dist/module/index.js","gitHead":"8f7bb2d9e07c465a5c625724b980f1f551dd28fa","scripts":{"flow":"flow","lint":"eslint src/ test/","test":"npm run format:check && npm run lint && npm run flow-typed && npm run flow && npm run karma","babel":"cross-env NODE_ENV=production babel src/ --out-dir dist/module","build":"npm run test && npm run babel && npm run webpack","clean":"rimraf dist coverage","debug":"cross-env NODE_ENV=debug","karma":"cross-env NODE_ENV=test babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/karma start","format":"prettier --write --ignore-unknown .","prepare":"husky install","release":"standard-version","webpack":"cross-env NODE_ENV=production babel-node --plugins=transform-es2015-modules-commonjs ./node_modules/.bin/webpack --progress --output-path dist","reinstall":"rimraf flow-typed && rimraf node_modules && npm install && flow-typed install","flow-typed":"rm -rf ./flow-typed && flow-typed install","prerelease":"npm run clean && npm run build && git add dist && git commit -m 'ci: check in dist folder' || echo 'Nothing to distribute'","postrelease":"git push && git push --follow-tags && npm publish","format:check":"prettier --check ."},"_npmUser":{"name":"sdk-integrations-npm","email":"sdk-integrations-npm@paypal.com"},"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"_npmVersion":"6.14.18","description":"Utilities for dealing with cross-domain windows.","directories":{},"lint-staged":{"**/*":"prettier --write --ignore-unknown"},"_nodeVersion":"14.21.3","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","husky":"^7.0.4","mocha":"^4","flow-bin":"0.155.0","prettier":"2.7.1","cross-env":"^7.0.3","flow-typed":"^3.8.0","lint-staged":"^13.0.3","@commitlint/cli":"^16.2.1","standard-version":"^9.3.2","@krakenjs/grumbler-scripts":"^8.0.5","@commitlint/config-conventional":"^16.2.1"},"standard-version":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","hidden":false},{"type":"docs","hidden":false},{"type":"style","hidden":false},{"type":"refactor","hidden":false},{"type":"perf","hidden":false},{"type":"test","hidden":false},{"type":"ci","hidden":true}]},"_npmOperationalInternal":{"tmp":"tmp/cross-domain-utils_3.1.0_1686601639638_0.20839703452067626","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-02-14T20:41:49.437Z","modified":"2026-09-29T18:53:50.723Z","2.0.39":"2022-02-14T20:41:49.651Z","2.0.38-beta.1":"2022-02-14T20:44:17.190Z","2.0.38-beta.2":"2022-02-14T20:56:25.371Z","2.0.38-beta.3":"2022-02-14T21:20:53.692Z","2.0.38-beta.4":"2022-02-14T23:28:34.097Z","2.0.38-beta.5":"2022-02-15T00:34:06.145Z","3.0.0":"2022-02-16T02:02:39.238Z","3.0.1":"2022-02-16T02:27:59.596Z","3.0.2":"2022-02-16T02:43:09.954Z","4.0.0-alpha.1":"2022-06-29T03:11:35.600Z","4.0.0-alpha.2":"2022-06-30T00:34:51.211Z","4.0.0-typescript.1":"2022-11-22T21:25:34.619Z","4.0.0-typescript.2":"2023-03-08T14:46:22.593Z","3.1.0":"2023-06-12T20:27:19.895Z"},"bugs":{"url":"https://github.com/krakenjs/cross-domain-utils/issues"},"license":"Apache-2.0","homepage":"https://github.com/krakenjs/cross-domain-utils#readme","keywords":["template"],"repository":{"url":"git://github.com/krakenjs/cross-domain-utils.git","type":"git"},"description":"Utilities for dealing with cross-domain windows.","maintainers":[{"email":"dustijones@paypal.com","name":"dustijones"},{"email":"sdk-integrations-npm@paypal.com","name":"sdk-integrations-npm"},{"email":"grjopa@gmail.com","name":"gregjopa"},{"email":"sioked@gmail.com","name":"sioked"},{"email":"brunson.ws@gmail.com","name":"wsbrunson"},{"email":"ravi_shekhar00@yahoo.com","name":"ravishekhar00"}],"readme":"## Cross Domain Utils\n\n[![build status][build-badge]][build]\n[![code coverage][coverage-badge]][coverage]\n[![npm version][version-badge]][package]\n[![apache license][license-badge]][license]\n\n[build-badge]: https://img.shields.io/github/actions/workflow/status/krakenjs/cross-domain-utils/main.yml?branch=main&logo=github&style=flat-square\n[build]: https://github.com/krakenjs/cross-domain-utils/actions/workflows/main.yml?query=workflow:build\n[coverage-badge]: https://img.shields.io/codecov/c/github/krakenjs/cross-domain-utils.svg?style=flat-square\n[coverage]: https://codecov.io/github/krakenjs/cross-domain-utils\n[version-badge]: https://img.shields.io/npm/v/@krakenjs/cross-domain-utils.svg?style=flat-square\n[package]: https://www.npmjs.com/package/@krakenjs/cross-domain-utils\n[license-badge]: https://img.shields.io/npm/l/@krakenjs/cross-domain-utils.svg?style=flat-square\n[license]: https://github.com/krakenjs/cross-domain-utils/blob/main/LICENSE\n\nA set of utilities for dealing with cross-domain windows\n\n## Installation\n\nAs of version 3 this package will be published under the `@krakenjs` scope.\n\n```\nnpm install @krakenjs/cross-domain-utils\n```\n\n## Public methods\n\n### `getDomain(win : Window) => string`\n\nGet the full domain of the specified window, as a string.\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- This can be overridden / mocked by setting `win.mockDomain = 'mock://some-domain.com';`. `mock://` is required to ensure the window can not spoof actual `http://` or `https://` domains\n\n### `getDomainFromUrl(url : string) => string`\n\nGet the full domain from the specified url, as a string.\n\n- it will try to extract the domain from the url string if it starts with well known protocols (`http://`, `https://`, `file://`, and additionally `mock://` urls)\n- if url string does not contain a known protocol, it will try to extract the domain calling `getDomain` using the current window as input\n\n### `getActualDomain(win : Window) => string`\n\nSame as `getDomain` but overriding / mocking is disabled. it will return the real full domain of the specified window.\n\n### `isBlankDomain(win : Window) => boolean`\n\nReturns if the domain for the specified window is blank, or `about:blank`\n\n- `win` must be a window on the same domain as the current window, or an exception will be raised\n- `win` may be a window or iframe that has been newly opened by the current window\n\n### `isSameDomain(win : Window) => boolean`\n\nReturns if the specified window is on the same domain as the current window.\n\n- Does so without raising any errors or console warnings, even in Safari where wrapping the check `try/catch` still raises a console warning.\n\n### `getParent(win : Window) => ?Window`\n\nGets the parent of the specified window, if the window has a parent.\n\n- Only returns the parent of iframes\n- Returns void if the window is the top-level window\n\n### `getOpener(win : Window) => ?Window`\n\nGets the opener of the specified window, if the window has an opener.\n\n- Only returns the opener of windows opened with `window.open`\n- Returns void if the window is the top-level window\n\n### `getParents(win : Window) => Array<Window>`\n\nGets all of the hierarchical parents of the specified window.\n\n- Only returns the parents of iframes\n- Returns a blank array if the window is the top-level window\n\n### `isAncestorParent(ancestor : Window, win : Window) => boolean`\n\nReturns true if the `ancestor` is a direct or non-direct parent of the specified window.\n\n### `getFrames(win : Window) => Array<Window>`\n\nReturns an array of all direct child frames found in a given window.\n\n- Only returns direct children\n\n### `getAllChildFrames(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window.\n\n- Recursively searches for all direct and indirect children\n\n### `getTop(win : Window) => Window`\n\nGets the top-level parent of the specified window.\n\n### `getAllFramesInWindow(win : Window) => Array<Window>`\n\nReturns an array of all recursive child frames found in a given window, and in the child-frames of that window, including the specified window.\n\n- Recursively searches for all direct and indirect children\n\n### `isTop(win : Window) => boolean`\n\nReturns true if the specified window is the top level window, without any parents.\n\n### `isFrameWindowClosed(frame : HTMLIFrameElement) => boolean`\n\nReturns true if the window attached to an iframe element is closed, by checking if the frame is still attached to an open document.\n\n- Prefer `isWindowClosed` when possible\n\n### `isWindowClosed(win : Window) => boolean`\n\nReturns true if a window has been closed\n\n- In IE/Edge, this check is not 100% reliable for frame windows where the frame has been removed from the DOM. Such window objects give no indication that they are closed.\n\n### `getUserAgent(win : Window) => string`\n\nGets the user agent for the specified window\n\n- Window must be on the same domain as the current window\n- Uses `win.navigator.mockUserAgent` if specified, to allow for mocking / tests.\n\n### `getFrameByName(win : Window, name : string) => ?Window`\n\nGets a frame window with the given name, if it exists as a child of the specified window.\n\n### `findChildFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the children specified window.\n\n### `findFrameByName(win : Window, name : string) => ?Window`\n\nRecursively searches for a given frame window inside the entire frame hierarchy of the specified window.\n\n- Searches both the children and the parent windows recursively for the frame.\n\n### `isParent(parent : Window, child : Window) => boolean`\n\nReturns true if the specified parent window is the parent of the specified child window.\n\n### `isOpener(opener : Window, child : Window) => boolean`\n\nReturns true if the specified opener window is the opener of the specified child window.\n\n### `getAncestor(win : Window) => ?Window`\n\nGets either the parent or the opener of the specified window, if either is present.\n\n### `getAncestors(win : Window) => Array<Window>`\n\nRecursively gets either the parent or the opener of the specified window, if either is present, and returns an array of the entire ancestor hierarchy.\n\n### `isAncestor(ancestor : Window, child : Window) => boolean`\n\nReturns true if the specified ancestor window is the parent or the opener of the specified child window.\n\n### `isPopup(win : Window) => boolean`\n\nReturns true if the specified window has been opened with `window.open` (i.e. if it is a popup window)\n\n### `isIframe(win : Window) => boolean`\n\nReturns true if the specified window has been opened as an iframe.\n\n### `getDistanceFromTop(win : Window) => number`\n\nGets the numerical distance from the specified window to the top level window in that window's hierarchy.\n\n- If the specified window is at the top, this will return 0.\n\n### `getNthParent(win : Window, n : number) => ?Window`\n\nGets the window `n` levels up from the specified window, if it exists.\n\n### `isSameTopWindow(win1 : window, win2 : Window) => boolean`\n\nReturns true if the windows are in the same hierarchy, with the same top level window\n\n- Will return false if one of the windows is a popup and the other window is not a frame inside that popup.\n\n### `isWindow(obj : Window) => boolean`\n\nReturns true if the specified object is a window instance\n\n### `onCloseWindow(win : Window, callback : Function, interval : number) => { cancel : Function }`\n\nCalls the callback when the specified window closes, with checks running on the specified interval.\n\n- Returns a listener object with a `.cancel()` method, to stop the loop\n\n### `matchDomain(pattern : (string | RegExp | Array<string>), domain : string) => boolean`\n\nReturns true if the specified domain matches the pattern. The pattern can be one of:\n\n- A literal string\n- A regular expression\n- An array of possible domains as strings\n\n# Tasks\n\nAll of the tasks are listed in the package.json file under the scripts section\n\n| Command       |               Description                |\n| ------------- | :--------------------------------------: |\n| npm run build |          Builds the dist files           |\n| npm test      | Runs the test suite. Lint + Type + Karma |\n\n# Debugging\n\nRun the debug task and pass the next tasks as argument.\n\n```\nnpm run debug -- npm run build\nnpm run debug -- npm test\nnpm run debug -- npm run karma -- --browsers=Chrome\n```\n","readmeFilename":"README.md"}