iframe

Is there anyway of getting javascript code injected in an iframe to execute without removing and reappending the script tag containing it?

女生的网名这么多〃 提交于 2019-12-21 20:43:00
问题 Context: I am building a live HTML,CSS & Javascript editor. It can be accessed here. The source can be accessed here. Question: Is it possible to run javascript code injected into an iframe without repeated removal and addition of <script> tag containing the code from and to the DOM tree? Since DOM manipulation is a costly affair, I want to try and eliminate multiple DOM manipulations. Instead I want to be able to just change the textContent of the <script> tag and have it run the new code

Blocking default action on keypress with iframe

亡梦爱人 提交于 2019-12-21 20:34:10
问题 This is a catch 22 I can't really figure out how to resolve. Take this HTML5 game we host: http://www.scirra.com/arcade/action/93/8-bits-runner - Warning has sound! The page is hosted on scirra.com but the game is in an iframe on static1.scirra.net for security reasons. Now if you press left and right, up or down when you are playing the game the entire window scrolls up and down, left and right. The prevent default seems to work OK when the game isn't focused. We want to prevent this default

Call a JavaScript function defined in an iframe in Chrome using the file protocol

冷暖自知 提交于 2019-12-21 20:22:27
问题 This question is extremely similar to the fully-updated version of the question asked here: How to call a JavaScript function from one frame to another in Chrome/Webkit with file protocol — unfortunately, that question was never actually answered. I have an HTML page that contains an SVG image in an iframe. The SVG exports a JavaScript API that allows it to do useful things (reset to zoomed and centered, display at "actual size"). Below the iframe, I've put buttons that the user can click on

Facebook Tab Height Scroll Bar

落爺英雄遲暮 提交于 2019-12-21 19:57:09
问题 I make a simple html page and set it on facebook fan page tab but the tab which shows on fan page is shows a scroll bar buti already set to auto resize and the height of this html page is large i want to hide the scroll bar and show the complete page 回答1: The best solution I found, which works for me is: You need to setup the Facebook app canvas settings, Canvas height to Fluid.  Then, add some javascript in the page header: <script type="text/javascript" src="https://connect.facebook.net/en

Rails 3.1 Having iframe in view makes layout stop rendering

喜夏-厌秋 提交于 2019-12-21 19:24:10
问题 So I have a basic layout file: <!DOCTYPE html> <html dir="ltr" lang="en-US"> <head> <%= stylesheet_link_tag "logged_out" %> <%= javascript_include_tag "application" %> <%= stylesheet_link_tag "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" %> </head> <body> <!-- header stuff here --> <%= yield %> <!-- footer stuff here --> </body> </html> And with any normal html its fine. However if I add in an iframe like this to a view: <iframe id="form" height="480

JavaScript errors (localstorage, cookie) loading sandboxed iframe within Chrome Extension

瘦欲@ 提交于 2019-12-21 18:33:04
问题 I'm writing a Chrome Extension that shows a preview of a website of a user's choosing in a sandboxed iframe. I'm finding that a lot of pages do not render properly in the iframe because they get JavaScript errors such which breaks scripts that are important to rendering the page (like hiding a loading dialog): "Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': The document is sandboxed and lacks the 'allow-same-origin' flag." "Uncaught DOMException: Failed to

Can I provide default “context” to jQuery?

拈花ヽ惹草 提交于 2019-12-21 18:15:11
问题 Background: The second "context" argument to the jQuery selector call (e.g: jQuery(selector, context) ) can be provided to give the selector engine a starting point from which to descend. This is often useful if you need to control content in an IFRAME (in the same domain). You simply pass iframe.contentWindow.document as the "context" argument. If any JavaScript code is loaded in the IFRAME which makes use of jQuery, and is CALLED FROM THE SCOPE OF THE OUTER WINDOW , then any reference to $

百度编辑器UEditor不能插入视频的解决方法

核能气质少年 提交于 2019-12-21 17:28:12
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> xssFilter导致插入视频异常,编辑器在切换源码的过程中过滤掉img的_url属性(用来存储视频url)_src/plugins/video.js里处理的是_url,而不是_src。<基本出处参见: https://github.com/fex-team/ueditor/pull/2957/commits/d4b875ce165b3225929496c2d85848afbff0deeb?diff=split > 1、在 配置文件ueditor.config.js 中,定位 //xss过滤白名单,即,whitList:{ },对 img: 增加 “_url” 属性: 2、在 video 标签后新增3给标签,使Ueditor分别能支持embed标签和iframe标签(此处原理参见 另一篇博客 ): 代码: source: ['src', 'type'], embed: ['type', 'class', 'pluginspage', 'src', 'width', 'height', 'align', 'style', 'wmode', 'play', + 'autoplay','loop', 'menu', 'allowscriptaccess', 'allowfullscreen', 'controls',

Cross Domain IFrame element.scrollIntoView() Safari Issue

半城伤御伤魂 提交于 2019-12-21 17:27:08
问题 I have ran into an issue that is plagued all over google but none of the provided solutions work correctly. I assume the majority of these solutions do not account for cross domain. I have a website which I would like to instruct users to embed into their site with a (full page) IFrame. The problem is on some versions of Safari only. Elements within the IFrame can not scroll themselves into view. I notice that if I do a same domain test the IFrame can scroll itself using window.parent

Google Docs viewer disable download

老子叫甜甜 提交于 2019-12-21 16:53:48
问题 Please take a look at this link http://jsfiddle.net/C7Py6/3/ The last icon on google viewer's toolbar - enables user to view on new browser window and download PDF. The question is, how can I make it view only and disable download (At least disable this toolbar item). Is that possible with google viewer? or is there any other viewer that works like Google Viewer but view-only? 回答1: You can host your PDF files on Google Docs and prevent viewer downloads. To do this do followings: Once you