Cannot re-display Swiffy movie - google-swiffy

Our webapp (an online advertising campaign console) supports ad tags that are converted from flash using Swiffy. In our UI, we have a page where you can preview and edit the ad, and some changes cause the preview (an IFRAME) to be reloaded with an updated preview (e.g. if we change the URL passed as the clickTag value to the ad).
The first time we display a Swiffy preview, everything works fine; but on the second and subsequent attempts, we see the following in the browser (Chrome 43.0.2357.130) console:
Uncaught TypeError: Cannot redefine property: __swiffy_override
(anonymous function) # runtime.js:163
(anonymous function) # runtime.js:799
It seems that what's going on here is that Swiffy is using Object.defineProperty(Date,"__swiffy_override",{value:Fh}). According to MDN, unless you specify {configurable: true} in the third argument, you will get this exception.
We're currently using the version of runtime.js from Google's CDN (https://www.gstatic.com/swiffy/v7.2.0/runtime.js). We could, of course, copy this into our own CDN and edit the javascript, but this has obvious maintainability issues.
Is this something that should be reported back to Google as a bug? (If so, how does one do that?)
Is this a problem other people have run into, and have work-arounds for?

It sounds like you are not actually reloading the contents of the IFRAME when updating the preview, otherwise the error shouldn't occur, Date.__swiffy_override would not be defined at that point.
If you aren't able to completely reload the content of the IFRAME, are you able to load the Swiffy runtime just once, and create a new swiffy.Stage for each preview update?
Note, I've not tested this, and it may not work in some circumstances (if at all). I'd be especially wary of creating swiffy.Stages with different ActionScript versions for instance. The safe bet would always be to completely reload the IFRAME each time.

Related

Firefox Dev-Tools - console not showing HTML-preview of XHR-Request anymore

I'm using the latest FF (108.0.1)
In the developer tools, when I submit an XHR-Request, I used to see the request's HTML-Rendering in the «Answer»-Tab of the console. This stopped working like 2 or 3 versions ago.
Now all I get is a blank page. If I switch to «unformatted» it shows the HTML-Code of the response.
When I use the «Network»-Tab, I do see the HTML Response. But the interaction with the result doesn't work anymore.
Explanation: I'm using Typo3's DebuggerUtility::var_dump() which creates a nice rendering of objects and arrays. I used to be able to expand the entries with a «plus»-sign, in the HTML-View of the console. Which is very handy. This is not working when I use the Network-Tab of the Dev-Tools.
Any ideas how to get that functionality back?
This bug got fixed a few days ago. That means it is working again in Firefox 110.
Though note that JavaScript was never executed in that preview because of security reasons, as far as I can tell. The output is pure HTML plus CSS like in your screenshot of the Response tab in the Network panel saying that JavaScript needs to be enabled.
So, the toggle there may only work if it is using a browser internal feature like the <summary> and <details> elements.

Content Script Injection at Install for Firefox Web Extension

If content scripts are specified in manifest.json for Firefox, Firefox will also load content scripts for already opened tabs and execute them even the tabs are already in loaded and ready state.
Google Chrome does not add any content script when extension is installed for already opened tabs. The content script is loaded when the page is refreshed for the older tabs.
I want to ask is Firefox's behavior is expected or bug?
As far as compatibility goes, it's a bug.
Chrome does not do that.
As a result, many extensions implement custom logic to achieve the effect.
One has to take into account side effects. Suppose your content script injects some UI into the page. Then the extension is updated. That amounts to extension restart, and suddenly you have 2 copies of the UI. Also valid if you just attach event listeners, as (at least in case of Chrome) the old content script's context continues to exist (in an "orphaned" state).
The last point is very important and probably the reason why Chrome doesn't do it by default. At some point I made a very long post about this problem - if you're going to report this as a bug to Mozilla, please include that. There's also this feature request that is related.
What would be sensible (and backwards compatible) is to add a parameter to content script description in the manifest - whether to inject into existing pages. It will be up to developers to guarantee that side effects are taken care of. This usually requires even more code to just communicate to the old script that it needs to wind down and clean up.

is "CKEditor for ASP.NET" deprecated?

I'm looking at the download page for ckeditor and I see that the ASP.NET control was last released in 2014. The version string is 3.6.6.2. Does this mean that the control is deprecated? It seems to work properly w/ 4.4.x, but I'm chasing down some weird ckeditor control issues and I wanted to make sure this isn't somehow the cause.
Some of the weird issues I've been chasing
Sometimes when I'm doing a save via form submit, I'll get an exception thrown by the guts of ckeditor: Uncaught IndexSizeError: Failed to execute 'extend' on 'Selection': 1 is larger than the given node's length.
Selecting text in the control prior to save makes it go away
Only happens in Chrome from what I can tell
If I remove the divarea plugin, that makes it go away
I feel like sometimes I'm getting weird errors with it complaining that jquery is missing when I use the asp.net control -- they don't seem to happen under the markup / script based method. I haven't pinned this down yet.
The overall build is the 3.6.6.2 of the asp.net control. The ckeditor build is 4.4.7. There are custom config.js files used in some places and in some places the control is configured by markup in the asp.net control.

Differences in Internet Explorer and Firefox when dynamically loading content then going forward and back

I'm developing a web application where, due to slow database access, not all content in a page is loaded immediately but rather dynamically when the user clicks a button after optionally making a selection.
This works fine. However, after dynamically loading content, if I navigate to a different web page, then navigate back, in Internet Explorer the loaded content will have disappeared, i.e. the page will have reverted to the originally retrieved page. In Firefox (and Opera as well), however, the loaded content will still be there, i.e. the page will look like it did before I navigated away from it.
The Firefox behaviour is the desired behaviour in my case, as the user would routinely navigate to subpages and go back to the main page. My question is therefore, is there any way I can force Internet Explorer to exhibit this behaviour, or are there any possible workarounds to get the desired result?
Here is my workaround solution for IE. It utilizes the fact that, even if the DOM is reset when navigating away and back to a page, input field values are still remembered.
For every dynamically loaded element, I also have a hidden input field where I "cache" the loaded value. I then have a function transferFromCache() which copies the values from each hidden input field to the corresponding element. This function is run at page init - which, in IE's case, is at page load AND every time one navigates back to the page.
This technique could probably be used to store the values of javascript variables as well.
I don't think there's a method to get IE to emulate FF in this manner. The reason is to do with fairly fundamental aspects of the browsers. FF uses a mechanism for it's page history called 'Fast DOM caching' which (from my limited understanding) basically means that when it puts a page into the browser history then it will store the current DOM (so the current page state) in a serialised format, which means that when the page is reloaded from history the state is preserved and FF can do this much quicker as a lot of work is already done (parsing the HTML into a DOM, etc). In comparison, IE will simply store the HTML received initially as it's history file and will reload it when navigating history.
Here is an article about saving state in session variables, which may help

Why doesn't Visual Studio always render my page correctly when debugging locally in fire fox 2.0x?

When I debug locally in fire fox 2.0x many times my page won't have the styles added properly or the page will not completely render (the end is seemingly cut off). Sometimes it takes multiple refreshes or shift-refreshes to fix this. Is this a common issue or is it just me? Any solutions?
I want to add that this is happening in fire fox 3.x to me as well. I add my javascript to the pages dynamically and this might be part of the issue. This is when I am working locally with Visual Studio.
Update: This does happen in IE but it happens much more often in Fire Fox. The issue seems to be only javascript and CSS files not loading. For example I get jQuery is not defined, $ is not defined etc. I don't think I have local IIS to test this on but from the server it always works perfectly. Fire Bug shows all my css and javascript files to be requested and received.
This could be a problem with IPv6 and DNS of the Firefox browser. This issue is known to slow down Firefox on localhost:SOMEPORT. The effect would be that some external files won't load (css, js etc.) resulting in a partially rendered page.
You can solve this issue by simply deactivating IPv6 in Firefox:
Insert about:config in the Firefox address bar
Set network.dns.disableIPv6 to true or alternatively add localhost to network.dns.ipv4OnlyDomains
A different way to fix this issue, is to a remove the ipv6 address from your hosts file this way: open the file
C:\Windows\System32\drivers\etc\hosts
(with administrator privileges) and remove (or comment out #):
:: localhost
Make sure that you narrow the scope of the problem. Does the problem just happen when debugging from VS or does it also happen with local IIS? With server-based IIS? Does it happen to other developers in your company? Is it really just FireFox or does it happen to Chrome, Opera, IE, etc?
Assuming that you've already worked that all out, I would suggest installing a FireFox plug-in called "Tamper Data". Open that and refresh the page. You'll see a record of every connection from the browser to the server (for each html file, image, css file, etc). Look to see if any of the them are very slow or not completing (perhaps one of those files is taking a long time and FF is waiting for it to finish before loading other important files).
Assuming that all of the files correctly loads, you should consider checking that the syntax is valid (maybe there is some unclosed tag or quotation mark that is causing FF confusion). I use a plugin called "Web Developer", but there are a lot of other options out there.
You could also use a plugin called FireBug to view the HTML behind various parts of the page to see if there are any noticeable problems. You start FireBug, go to the HTML tab, click Inpsect, and move your mouse over something on the page, and it will show you the HTML behind it.
One thing to do would be to check the source of the page(s) in question. My guess would be that the local server that VS runs is not giving you the entire source of the page. One way to verify this would be to run exactly the same code in the debug environment, as well as from a "real" server like IIS 6. If the same behavior is seen on loading the page from both servers, as well as insuring that the full page source is being recieved by the browser(s), then it is a bug in Firefox and should be reported. This is especially true if other browsers, ie. IE, Chrome, Safari, Opera, render the page fully.
Are you comparing what you see in Firefox to what is displayed in the Visual Studio designer? If this is the case, then they are using 2 different methods to render the html and may not display the same.
Anything further on this folks?
I have examined the traffic using Firebug and it appears that when veiwing the response from the request for a style sheet, the response is just blank. After refreshing (sometimes multiple times) the age displays correctly and the response information contains the style sheet. I have not seen this in any other browser and it only occurs when viewing the app from Visual Studio.
2! Recently i had the same problem. Im using MVC 1.0 and I added a new stylesheet into Views/Share folder. And when i run the project, the page didnt render along with the css. If your web project is a MVC one so try put the css file into the Content folder.
Hope this help.
HaiVu.Doan.
In case anyone else finds this with newer versions of Visual Studio, I have to run VS as Administrator. This is something I keep forgetting to do, but once I right clicked on Run as Administrator when opening VS, the problem went away.
Initial problem, I could not get CSS to render when running a project from VS 2012 using Firefox as the browser. (IE worked just fine, btw.) The content would be there, but no CSS. This was the first post I found when I typed in my question.

Resources