* Returns true iff `url` has the same origin as the AMP document. * @param {string} url * @return {boolean}
(url)
| 477 | * @return {boolean} |
| 478 | */ |
| 479 | sameOrigin_(url) { |
| 480 | const urlService = Services.urlForDoc(this.element); |
| 481 | const docOrigin = urlService.getSourceOrigin(this.getAmpDoc().getUrl()); |
| 482 | const scriptOrigin = urlService.parse(url).origin; |
| 483 | return docOrigin === scriptOrigin; |
| 484 | } |
| 485 | |
| 486 | /** |
| 487 | * Returns true if mutations should be allowed based on container attributes. |
no test coverage detected