Extension Development: Frozen Firefox scrollbar and dis-functional hot-keys - firefox

I am writing a Firefox extension which creates a Java applet in the page.
function addApplet(aDocument,url,classfile,archive) {
if (navigator.javaEnabled()) {
var anApplet,body;
body = aDocument.getElementsByTagName('body')[0];
anApplet = aDocument.createElement('applet');
anApplet.setAttribute('CODEBASE',url);
anApplet.setAttribute('code',classfile);
anApplet.setAttribute('archive',archive);
anApplet.setAttribute('name',"Applet");
anApplet.setAttribute('width',"0");
anApplet.setAttribute('height',"0");
body.appendChild(anApplet);
}
}
The JAR file loaded from the applet is 500KB in size. I noticed that sometimes the extension causes Firefox's vertical scrollbar to freeze and the hot-keys to stop working. The scroll-bar and hot-keys work fine if I prevent the extension to append the applet to the page.
Another weird behavior is -- on the frozen page if I click inside any text/search box or even address bar the scroller and the hotkeys begin to work again. The same thing happens if I switch tabs or minimize the browser window.
I am using Firefox 3.6.12 on WindowsXP.
Please help me if you have an idea regarding this or if I should provide more information.
(Hey guys this problem is still not solved....please help me out with this......)
Thanks

See if something similar happens if you load the applet from an html page that includes the tag and its children as static content, rather than content added to the DOM.
I imagine it's a problem of Firefox and java, not your code.

Applets can be tricky. I would suggest creating a page of pure HTML that works, first.
As far as suggestions for change go, 1st thing to change is the width/height of the applet. An applet with 0 size can cause all sorts of problems. Instead, give it a WxH of 20 (then later hide it using CSS).

Ok this has worked:
Solution:
This behavior is the default since JDK 1.3. However you might need to prevent the applet from getting focus on startup, for example, if your applet is invisible and does not require focus at all. In this case, you can set to false the special parameter initial_focus in the HTML tag, as follows:
<applet code="MyApplet" width=50 height=50>
*<param name=initial_focus value="false">*</applet>
Cheers,

Related

Vaadin ckEditor addon has two panels

No matter what I do when I run the latest version of ckEditor I have two panels on my screen. Both are populated with data. Although you can only see one editor in full on the screenshot if I increase the height you can see both editors. I've brought the code down to the bare minimum. It use to work but in the latest version I always have two editors no matter what I do, and no matter what browser I use.
Also when I call getValue() on the editor it always brings back the value of the bottom editor. I've confirmed this by putting different values in the different editors.
My code is:
protected void init(VaadinRequest request) {
{
CKEditorTextField ckEditorTextField = new CKEditorTextField();
ckEditorTextField.setValue("hello world");
ckEditorTextField.setHeight("500px");
ckEditorTextField.setWidth("500px");
setContent(ckEditorTextField);
}
And yes I know I should use CKEditorConfig but I've tried to minimize all code to the bare minimum. I've also tried with layouts and it makes no difference. The reason I put the height and width is to make it more visible, but it's not required. Also this code is called on the main UI class.
The issue was that an upgrade to Vaadin hadn't properly taken, there were still some caching issues. The way to resolve it can be found here: https://vaadin.com/forum/#!/thread/2963857/2963856
The steps are:
Ivy-> Clean all caches
Ivy -> Resolve
Reboot Eclipse
Compile Vaadin widgets

CKeditor Firefox drag and drop encoding

Running into problems with CKeditor 4.5.6 involving dragging content into ckeditor's editor.
To be more precise, When dragging and dropping content from outside of the current browser window the content is either stripped of formatting (from Word for example) or converted to other language symbols (if from a browser for example). For instance dragging the 'Similar Questions' title from the page I'm typing this question in produces:
Example of Firefox/CKeditor problem
However, dropping the url in the url bar for instance works correctly.
This issue only appears in Firefox. Chrome and IE work fine and I can drop formatted text from anywhere including Word and only my accepted tags (using CKeditors content filter) will correctly make it into the editor.
My page is using UTF-8, the pages I'm dragging from also use UTTF-8.
I've exhausted the forums looking for a solution and would greatly appreciate any help.
Thanks!
UPDATE:
After tinkering around in FF's console and exploring the drop event object I used the code:
CKEDITORSETTINGS.ckeditor.document.on('drop', function (evt) {
var data = evt.data.$.dataTransfer.getData('text/html');
console.log("paste data: " + data);
});
Which shows that the paste data is also incorrect. So this looks to be a Firefox issue unless I find any more leads.
Update #2:
Narrowed down further: this issue is ONLY when dropping data from OTHER browsers into FF
Update #3:
Updated FF to current version (45.0) and the issue is resolved.
What a wild goose-chase!

Firefox pdf form displays a "4" in checkbox (instead of a checkmark); Works fine in IE & Chrome

I am creating a pdf document (via ColdFusion), but when I preview the rendered pdf in Firefox, I get the number "4" where my checkmarks are supposed to be (see photo below). When I preview the exact same pdf in Chrome or IE, I see the checkmark, and it all works perfectly!
I am pre-populating the pdf form fields (via ColdFusion session variables), and then rendering the pdf using the following markup:
<cfpdfform source="82040.pdf" action="populate">
<cfpdfformparam name="org" value="">
</cfpdfform>
Here is the resulting pdf form in Internet Explorer:
Note how the checkmark is rendered properly:
Here is the same form previewed in FireFox:
Note how the the checkbox has a "4" instead of a checkmark:
Any help would be greatly appreciated!
It is a bug with Firefox's PDF Viewer. Currently, there is no fix. As radiovisual's post points out, the bug in the underlying library (pdf.js) was supposedly fixed. However, there is still the issue of Mozilla updating the older version baked into Firefox (which is what most folks are using). Currently, that bug is still outstanding.
Probably the best you can do is to return the pdf as an "attachment", rather than "inline", so the browser prompts them to "open/save" the file. If the user opts to "open" the pdf, it should open with their default program instead. (Adobe Reader is the default for most users).
<cfheader name="Content-Disposition" value="attachment; filename=fileName.pdf">
<cfcontent type="application/pdf" .../>
Update:
This bug was apparently addressed already, as pointed out via the project's github repo: the bug was supposedly fixed during this commit. So if you are still experiencing problems, it either means:
You are using an outdated version of the pdf.js library,
Or, the problem has been re-introduced into the library.
So to start things off, you will want to make sure that you are using the most up-to-date version of the pdf.js library. If you are still experiencing problems, even with the most up-to-date version, then the problem is still within the embedded pdf document viewer, and there aren't too many things you can do to fix this until the project maintainer's finally fix the problem.
The issue you are experiencing (the reason why you are seeing a "4" where there should be a checkmark, is because the pdf.js library is using a special symbol font to render the checkmarks, but in problematic versions of firefox's embedded pdf-viewer the symbol font isn't rendering the checkmark correctly, so it shows a "4" instead of a checkmark -- because the checkmark symbol they are using in the custom font just so happens to be mapped to the number "4".
Similarly, for the same reasons cited above, if you assign the checkbox to render squares (instead of checks), the letter "N" will appear in the checkbox instead of a square, because the square shape symbol is mapped to the letter "N".
This problem only exists in the embedded pdf document viewer in Firefox but will look perfectly normal when viewed in Adobe Acrobat Reader, or other offline pdf readers (and other browser pdf readers, which is why it looks fine in Chrome and IE), so when users download the form, it will appear like you would expect it to.
Some workarounds / optimizations you could try:
Try one of these, or all of these, they are in no particular order (or guaranteed to work)
Don't rely on the built-in pdf.js browser extension in firefox, instead, make your own updated version based on the latest pdf.js source or target another pdf library and use it's browser-agnostic API to render and display your pdfs.
Create an HTML form for the user to fill and verify all the information, then render the pdf based on the data supplied by the HTML form, for download only (no previewing in the browser). This will force them to open the pdf in their default pdf viewer where the issue is not present, because, again, the problem you describe only happens in Firefox's embedded pdf viewer and not in other pdf viewers like Adobe Acrobat).
Make sure you have the ZapfDingBats Font installed on your server. I haven't confirmed this, but that commit that was supposed to have solved this issue seems to have added support for this font, so it is worth a try to make sure this font is accessible on your ColdFusion server, then try previewing the rendered pdf in Firefox.
Detect that the user is accessing your form via Firefox, and if so, warn the users of the issue, but assure them that downloading the form and viewing in their default pdf viewer will work as expected.
Convert the page to HTML5 (if you aren't already), then add in an HTML5 shiv (so HTML5 features can be used on older browsers), and a CSS normalizer, and test if the problem persists using these optimal settings. It's worth a shot to make sure that the problem is somehow treated differently under the HTML5 standard, since not everyone is having the same issues as you.
Lastly, make sure that your HTML is being rendered as valid markup via your ColdFusion output by using an HTML validator.
Other than that, there isn't a whole lot you can do until the mozilla team updates their embedded pdf viewer. But since the problem is only in the firefox viewer, and not in the pdf itself, it it up to you to decide if this is a deal-breaker or not, and search for alternatives.
Note: PDF.js is built into version 19+ of Firefox.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update: You can use this pdf (which represents the character mapping of the ZapDingbats symbol font) as a way of testing your browser's interpretation of embedded fonts in the pdf rendered via pdf.js. Note that at the time of this writing, the above pdf does not display the Zapf Dingbats properly in Firefox (via pdf.js), but other browsers render them just fine (notice the "4" next to a20[x2714] in firefox, and the checkmark next to the same entry (a20[x2714]) in Chrome.

ckeditor: mediaembed plugin won't work

I'm using CKEditor for my site.
Now I found the plugin called "MediaEmbed". I need it for embedding YouTube videos.
I installed it and the integration worked fine, but embedding won't work.
When you paste the code into the text area in the embedding dialog and then click on OK in IE and Chrome nothing happens and in Firefox it just adds a image as a flash-content-placeholder.
Let's say the flash-content-placeholder image would be just in the wysiwyg interface, but then i should get the embed code when I click on "view source" - but no, there you just see the source of the placeholder image div and img tag.
Then let's say the embed code is saved internally, so I save the file I create with CKEditor, and the out I get is just what I entered without the stuff the MediaEmbed plugin has generated at all.
How to fix this?
Please help!
Yours Joern.
use firebug and see, it'll be giving a cross domain error. the plugin has a bug. use try catch in the place where is accesses the windows.name property for a workaround.
Try istead ckeditor youtube plugin

CSS reload on IE7

It looks like IE7 doesn't reload the latest version of my stylesheet each time I upload a new version on the server.
This is annoying as I am debugging my .css file to make it work on IE...
Tried to empty the browser cache but still not working.
Thanks for your help.
Ctrl-F5 - forcible way to reload in IE
Include your version number in the file name. myfile_v1234.css
When testing, every time you do an update you can just wite "stylesheet.css?r=98123"
As long as the query string is different, it'll be downloaded again.
If you need, you can use javascript to append Math.random(), to get the random number. Not required on production though, when updates would be stable.
2 Questions:
Does IE eventually load with the newer stylesheet?
How are you saving the changes to the server (SSH, Web Interface, etc.)?
I ask because I ran into an issue with a web-based file management system a while back where one browser would show the CSS just fine, the other wouldn't, and we noticed the issue of which browser played nicely depended on which browser we used to upload the CSS.
The reason turned out to be that IE gave the CSS file a different MIME type than Firefox. If you continue to notice the issue even when you've cleared the cache, check the MIME type of the file using Firefox by going to Tools > Page Info.
Also, if it is simply a caching issue, consider turning caching off in IE. I believe this should be an Advanced Option under Internet Options.
Also, you may want to try creating a special developer environment for IE (if it comes down to it.) Perhaps have another machine with IE7 and no caching and any other features turned off (A kiosk mode, perhaps), and then previewing the page on that machine.
Thanks to you all!
I did manage to solve my problem with the "stupid" Ctrl+F5, and by changing the Internet Parameters of Windows to reload content every new visit.

Resources