Fix not working in cross domain iframe
This commit is contained in:
parent
e64ee69617
commit
9dccb8e20c
|
@ -108,7 +108,12 @@ export default class TranslateContainer extends Component {
|
||||||
disableExtensionByUrlList = () => {
|
disableExtensionByUrlList = () => {
|
||||||
const disableUrlList = getSettings("disableUrlList");
|
const disableUrlList = getSettings("disableUrlList");
|
||||||
const disableUrls = disableUrlList.split("\n");
|
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 => {
|
const isMatched = disableUrls.some(urlReg => {
|
||||||
if (urlReg.trim() === "") return false;
|
if (urlReg.trim() === "") return false;
|
||||||
|
|
Loading…
Reference in a new issue