EverKB

Knowledge Base Ever

Not allowed to navigate top frame to data URL문제 해결

2019-12-14 12:17:44

라벨: Chrome, src, data, 상단 프레임을 데이터 URL로 탐색 할 수 없습니다.

Chrome 구현에 대한 토론 : A 태그, window.open 및 window.location을 사용하여 웹 페이지가 TOP 프레임에 데이터 URL을로드하지 못하도록합니다.

그 이유는 데이터 : URL이 사용자에게 매우 혼란스럽고 사기 및 피싱 공격에 널리 사용되는 또 다른 문제는 전자 메일에 포함 된 것처럼 직접 전송할 수 있기 때문입니다.

해결책

iframe 구성표
var string = doc.output('datauristring');
var iframe = "<iframe width='100%' height='100%' src='" + string + "'></iframe>"
var x = window.open();
x.document.open();
x.document.write(iframe);
x.document.close();
JSPDF PDF 솔루션 생성
var pdfUrl = doc.output('datauri').substring(doc.output('datauri').indexOf(',') + 1);
var binary = atob(pdfUrl.replace(/\s/g, ''));
var len = binary.length;
var buffer = new ArrayBuffer(len);
var view = new Uint8Array(buffer);
for (var i = 0; i < len; i++) {
    view[i] = binary.charCodeAt(i);
}

var blob = new Blob([view], { type: "application/pdf" });
window.open(doc.output('blob'), '_blank');

라벨

CentOS7 CentOS PHP Linux Python3 Python MySQL MariaDB YUM JavaScript mysql_native_password PHP7 CSS Redis MySQL8 caching_sha2_password HTML CodeIgniter font-size root Tag Cloud apache httpd dual network interfaces Laravel ss5 vertical-align CURLFille horiz-align node.js ShadowsocksR BarManager exec mb_substr PyCharm SUBDATE WebStorm date add IntelliJIDEA PEAR SOCKS5 Proxy Server Chrome find remi Tag Apache du jQuery PHP5.5 src V2Ray cURL hide nginx Shadowsocks-Python availability eth0 MariaDB10.4 PostgreSQL sub folder Web Server date Install MongoDB pdo_sqlsrv SOCKS5 File Upload mssql-tools register_shutdown_function Symfony Zend Framework ADDDATE DevExpress JetBrain php-fpm sqlsrv unixODBC-devel height network interface Shadowsocks-Libev Aura error_get_last Port 80 string Web Development data INDENTIFIED BY password policy requirements SOCKS Fedora Media Writer msodbcsql Redis5 SVN absolute Deepin jemalloc SQLAlchemy toggle convert FuelPHP mysqlclient Shadowsocks at-symbol Error Control Operator margin PHPUnit Framework ss5.passwd vps daemon process IIS password SOCKET center Fatal Errors MongoDB4 sudoers WiFi .htaccess DATE_SUB Phalcon SQL Server 2017 Compiling PHP frequency conflict set_error_handler TestCase apr Elasticsearch7.3 PHPUnit ss5.conf Vincent Garreau daemon HTTP particles.js Slim Failed to build these modules: _uuid MongoDB Sudo width DATE_ADD ip command pg_bha.conf SQL Server Compiling Apache Frameworks MySQL-python scrollbar Tcp BBR Apache2.4 Elasticsearch libpython3.7m.so.1.0 PHPStorm ss5-3.8.9 VIM CURLOPT_POSTFIELDS NodeJs show Bluetooth Failed to build these modules: _ctypes Minimal ISO substr Wi-Fi date sub INTERVAL PECL SQL Date Funcitons

최신 기사