Closed Bug 778073 Opened 8 years ago Closed 7 years ago

Java in Firefox Extensions (but The Window.java and Window.packages attributes has been removed in Firefox 15)

Categories

(Core :: DOM: Core & HTML, defect)

15 Branch
x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
firefox15 + fixed
firefox16 + wontfix
firefox17 + wontfix

People

(Reporter: tigromen, Assigned: jaas)

References

Details

(Keywords: addon-compat)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11

Steps to reproduce:

This article
https://developer.mozilla.org/en/Firefox_15_for_developers  
says that 
The Window.java and Window.packages attributes has been removed. These were never documented, and hopefully you're not using them!

I use java in my extension ( from article https://developer-new.mozilla.org/en-US/docs/Java_in_Firefox_Extensions) 

How I can use java in my extension in Firefox 15 ? thank you
Severity: normal → blocker
Component: Untriaged → Extension Compatibility
Severity: blocker → normal
Component: Extension Compatibility → DOM
Depends on: 748343
Product: Firefox → Core
Blocks: 748343
No longer depends on: 748343
Requesting tracking until we make a call on the addon-compat issue here....
Status: UNCONFIRMED → NEW
Ever confirmed: true
Are you loading java in chrome or web code? I believe it should still be fairly straight forward to create a applet tag to instantiate a JVM and then call into it -- we might need to make <applet> a bit more flexible depending on what addons are doing with it.
We really don't want any special Java integration in Gecko at all, except as a normal NPAPI plugin. You should try to instantiate a Java applet if you need Java.

I don't know who make addon-compat calls, but I suggest wontfix for this bug.
For now I do not understand how to use <applet> in my extension. I'm writing an extension that does not modify any page only provides additional functionality to the web browser itself. Where should I load and keep <applet> to use it? Is there a possibility to create XUL-window and keep applet there?

Now I use java in my extension like singelton (component) -it shares between several instances of browser. Is there a way to keep this functionality?
(In reply to Boris Zbarsky (:bz) from comment #1)
> Requesting tracking until we make a call on the addon-compat issue here....

Including Jorge here to help with understanding the prevalence of these attributes in 3rd party add-ons.
While Java usage in add-ons is rare, this change does affect a number of large add-ons. It's certainly in the dozens, but I doubt it's in the hundreds.

In my opinion there should be a deprecation period where usage of the java global is shown in the Error Console. Our existing Java for Extensions documentation should also be updated to whatever alternative there is, or at least say that there isn't one.
(In reply to Jorge Villalobos [:jorgev] from comment #6)
> While Java usage in add-ons is rare, this change does affect a number of
> large add-ons. It's certainly in the dozens, but I doubt it's in the
> hundreds.
> 
> In my opinion there should be a deprecation period where usage of the java
> global is shown in the Error Console. Our existing Java for Extensions
> documentation should also be updated to whatever alternative there is, or at
> least say that there isn't one.

Agreed - let's back bug 748343 out for FF15/16 and replace them with a deprecation warning. We should also try to communicate this to add-on devs (blog?).

Josh - can you get the backout lined up prior to tomorrow's go to build?
Assignee: nobody → joshmoz
I see that java will be removed from version 15 (https://bugzilla.mozilla.org/show_bug.cgi?id=748343).

So, in version 15 i cannot use java in my extension? Can I insert iframe in XUL window and than use <applet>. Can I load my jar files and use java ?
(In reply to Jorge Villalobos [:jorgev] from comment #6)

> In my opinion there should be a deprecation period where usage of the java
> global is shown in the Error Console. Our existing Java for Extensions
> documentation should also be updated to whatever alternative there is, or at
> least say that there isn't one.

There is a warning in Firefox 14, and even if it was in longer I don't think it does much to prompt people to fix addons. Only removing the "feature" will get developer's attention, and this really needs to go.

I am off today and won't be able to handle a backout until tomorrow. I'd prefer to come up with a plan for addon developers and not back out though. It shouldn't be hard to load java.
(In reply to tigromen from comment #8)
> I see that java will be removed from version 15
> (https://bugzilla.mozilla.org/show_bug.cgi?id=748343).
> 
> So, in version 15 i cannot use java in my extension? Can I insert iframe in
> XUL window and than use <applet>. Can I load my jar files and use java ?

Yes, of course... You should be able to insert an applet tag anywhere you want and get it to load your jar file. As for where to insert it to, I couldn't tell you and it will largely depend on what you're doing, what the lifetime of your java code should be, etc. Cc:ing some front end guys who might have thoughts on that.
I need to use java after my extension started all time while firefox running. 
So I insert applet to some xul file. Then my ext loaded and start applet. Can I use java methods in my extension like descxribes in https://developer-new.mozilla.org/en-US/docs/Java_in_Firefox_Extensions ?

I see that very small information about applet on mdm (https://developer.mozilla.org/ru/search?q=applet). For example https://developer.mozilla.org/en/HTML/Element/applet obsolete. 
Where I can find instruction to use applet in extension?
(In reply to Josh Aas (Mozilla Corporation) from comment #9)
> There is a warning in Firefox 14, and even if it was in longer I don't think
> it does much to prompt people to fix addons. Only removing the "feature"
> will get developer's attention, and this really needs to go.

I think the deprecation period should be longer than one cycle. I just heard about this and haven't had time to communicate this to developers in any way. Just a few weeks is not enough time for them to update their add-ons. I'd like to request at least 2 more cycles before this is removed.

> I am off today and won't be able to handle a backout until tomorrow. I'd
> prefer to come up with a plan for addon developers and not back out though.
> It shouldn't be hard to load java.

If someone can update the docs to indicate how to do this, that'd be great.
(In reply to Jorge Villalobos [:jorgev] from comment #12)
> (In reply to Josh Aas (Mozilla Corporation) from comment #9)

> I think the deprecation period should be longer than one cycle. I just heard
> about this and haven't had time to communicate this to developers in any
> way. Just a few weeks is not enough time for them to update their add-ons.
> I'd like to request at least 2 more cycles before this is removed.

Can we compromise on one more cycle? Like I said, I'm pretty keen on seeing this removed ASAP and I don't think people pay much attention to those warnings. Even if they do, many will wait until their hand is forced, which will drag this out for many, many months. I suspect an extra cycle will do little/nothing, at the end of it we'll still have nearly the same number of un-updated extensions. If you have evidence to the contrary let me know.
So, after the  deprecation period there will be no way to call java from the extension. Is it correct?
(In reply to tigromen from comment #14)
> So, after the  deprecation period there will be no way to call java from the
> extension. Is it correct?

No. Addon developers will just have to instantiate a Java plugin themselves. I'm not sure exactly how to do it myself but I'm pretty sure it can be done.
(In reply to Josh Aas (Mozilla Corporation) from comment #13)
> Can we compromise on one more cycle? Like I said, I'm pretty keen on seeing
> this removed ASAP and I don't think people pay much attention to those
> warnings. Even if they do, many will wait until their hand is forced, which
> will drag this out for many, many months. I suspect an extra cycle will do
> little/nothing, at the end of it we'll still have nearly the same number of
> un-updated extensions. If you have evidence to the contrary let me know.

Well, for one, we can identify the add-ons that use Java and message the developers directly. I just don't expect them to update their add-ons and have them reviewed within half a release cycle, specially if we don't have any documentation explaining what the alternative is.

I don't understand why is it such a big deal to keep Java on for 2 more cycles. Is it doing any harm?
(In reply to Jorge Villalobos [:jorgev] from comment #16)

> I don't understand why is it such a big deal to keep Java on for 2 more
> cycles. Is it doing any harm?

It is harmful, that's why we're trying to remove it. See bug 748343 for all of the reasons it is harmful.
Let's do just one more cycle, then. I'll get the docs updated and notify the developers as soon as possible.
Backed out on beta, marking this fixed.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Updating status flags to reflect that we fixed this for 15 by backing out bug 748343 on 15, but this is wontfix for 16 and 17 as there will be deprecation messaging to those branches as per comment 18.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.