Fix not working in cross domain iframe

This commit is contained in:
sienori 2019-05-03 05:23:55 +09:00
parent e64ee69617
commit 9dccb8e20c

View file

@ -108,7 +108,12 @@ export default class TranslateContainer extends Component {
disableExtensionByUrlList = () => {
const disableUrlList = getSettings("disableUrlList");
const disableUrls = disableUrlList.split("\n");
const pageUrl = top.location.href;
let pageUrl;
try {
pageUrl = top.location.href;
} catch (e) {
pageUrl = document.referrer;
}
const isMatched = disableUrls.some(urlReg => {
if (urlReg.trim() === "") return false;