Presentation Screenshots Download Support Development Forum    
   

Welcome to the Community Forum.

Here you can discuss with other users or with the author, suggest new features, report bugs, ask for filters creation or correction, etc. Select the forum you wish to read or post below :

Forum
Forum > Development & Bug report > Feedback about 0.9.4beta

Pages : 1 2 3 4 5 [6]
Topic locked
User info Feedback about 0.9.4beta
Cyan
Avatar
Feb 2 2010, 1:05 pm
This issue is just because both our add-ons uses and rewrites the same function.

I don't think we can correct this conflict without one disabling the right-click function.
I'm thinking MAF can't disable it (because this is the main functionality of the add-on), so it will be my responsibility to make an option to enable or completely disable right-click for ASF.

I don't think they can make anything to correct the conflict by their side only. Or if they know how to path on-the-fly a function, I would be happy to learn from them.


For the Private browsing mode though, I think they have to add it back to let people use it fully, else users would not know it has been disabled and they think they are fully private when they aren't (except if it's explicitly written on the add-on page or inside the add-on dialog windows that it's broken).


In fact I think I will add a temporary fix to disabled ASF right click before final 1.0
please test the next beta I will release.
Post #51
Edit
P.A.
Avatar
Feb 2 2010, 3:43 pm
Hello,

I saw the post regarding the extension conflict in the Firefox Add-ons website,
and I think I can contribute a solution to the problem. Since ASF only needs to
execute a function before "getTargetFile" is called, there is a technique that
can be used to achieve just that, without having to patch the function using
"eval", which is not a recommended practice anyway.

The technique consists in writing a wrapper function that replaces the
original one, but the wrapper actually invokes the original function instead
of reimplementing it. The "apply" method of the "Function" object is helpful
to pass along all parameters indiscriminately, and to ensure that the "this"
identifier points to the right object.

To use this technique with "getTargetFile" with MAF installed, you must ensure
that the modification is applied after MAF replaces the original function. You
can do this by getting the reference to "getTargetFile" in the "onLoad" handler
instead of the global code.

In practice, just replace this line...

window.getTargetFile = this.asf_getTargetFile;

...with the following code:



// Apply this modification only if the original function exists
if (window.getTargetFile) {
// Save a reference to the original function
var original_getTargetFile = window.getTargetFile;
// Override the original function
window.getTargetFile = function() {
// Call our function before the original one
automatic_save_folder.rightclick_main.apply(automatic_save_folder,
arguments);
// Execute the original function and propagate the return value
return original_getTargetFile.apply(window, arguments);
}
}



You can then remove the unneeded code from the module.



I use this technique to provide the "Title Save" functionality in MAF. Here
is where MAF does this (in the global code, instead of onLoad, since I don't
have the requirement of replacing another extension's function):

http://hg.mozdev.org/maf/file/cc75107e9542/src/chrome/content/integration/defaultFileNameOverlay.js#l43



As for the support for private browsing mode, I'll work for reintroducing
it in the next version of MAF. I'm available on the MAF mailing list if you
know of other bugs and want to report them.

Hope this helps,
Paolo Amadini
Post #52
Edit
Cyan
Avatar
Feb 2 2010, 4:34 pm
Thanks a lot for sharing this code :)

It will be helpful to keep the original Mozilla function and add my code quickly, and it will be compatible with all future versions as well.


I will test it, I think I will have to rewrite a lot of things now :p
There were a detection for Firefox <3.0 (because I used a function including private browsing not working on 2.x) and detection for DownloadSort (it's replacing the getTargetFile the same way I do), with written text to user interface to explains the problem.

Good luck with your add-on and thanks again.
Cyan
Post #53
Edit
P.A.
Avatar
Feb 2 2010, 5:36 pm
I'm glad that this technique helps with what you need in your extension.
I look forward to seeing it implemented :) Keep up the good work!

Paolo
Post #54
Edit
Cyan
Avatar
Feb 2 2010, 10:27 pm
Thanks to Paolo, I made a beta which (should !) works with MAF.
His function is great and should works with every other add-ons and Firefox version :)
(Except DownloadSort which rewrite the saving function entirely and prevent ASF to work)

I will have to check if I can replace the single-click function the same way in order to implement the file renaming mask function.
The file nsHelperAppDlg.js is located in Mozilla Firefox\components\ folder

@abc : Please could you try this version :
http://asf.mangaheart.org/xpi/beta/automatic_save_folder-0.9.4bRev54.xpi

If it's working fine, I'll update the svn.




At my work, I saw another graphical error/bug
I don't know what is the problem, as I don't have this issue on my computer:

When downloading a file, clicking on the box titled "Automatic Save Folder" should minimize and hide it's content.
On my Firefox, it's working fine (tested on 3.0, 3.5 and 3.6, windows and linux)

At my working place (FF3.6 on windows), the ASF box is slightly moving down when minimized.
I don't understand if the problem is originating from firefox or ASF box (it seems it's the Firefox box which is resized, and the DOM inspector doesn't help much).

Do any of you have this problem too ?
Post #55
Edit
abc
Avatar
Feb 3 2010, 1:19 am
I'm happy to report that saving pages works when using your newest ASF beta and MAF!

Also I do not have the issue with the moving ASF box when its minimized. I didn't know it would minimize when clicked until you mentioned it actually.

Thank you very much!
Post #56
Edit / Delete
Pages : 1 2 3 4 5 [6]
Topic locked

Return to top