Last active
February 17, 2016 09:37
-
-
Save pocotan001/e49db54f292e7a596e93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import url from 'url'; | |
const WHITE_LIST = ['hoge.com', 'piyo.com', 'huga.com']; | |
/** | |
* 対象のサイトで iframe の埋め込みを許可するかどうか | |
* | |
* @returns {boolean} | |
*/ | |
const isAllowEmbed = () => { | |
const hostname = parent !== window ? url.parse(document.referrer).hostname : null; | |
return WHITE_LIST.indexOf(hostname) !== -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment