Below is a quote from
bugzilla bug Bug 1085382.

How can we run a preprocessor on a .js file use it instead of
the raw unprocessed filef for C-C TB?

What is a difference between a .js file that gets processed and the ones
that doesn't?

TIA

--- begin quote ---
Created attachment 8514294 [details] [diff] [review]
Work-in-progress patch Take 2.

I am in the process of debugging.

I am attaching a work-in-progress patch.  (I have not addressed yet
the build issue of failure when the files under phishing directories
are removed. moz.build, etc. need to be changed for successful build.)

I have uploaded a WIP patch since I encountered a problem again.

There are two files that need to be modified for removing the
reportPhishingURL:
 - mail/base/content/nsContextMenu.js
 - mail/base/content/mailWindowOverlay.xul

I think .dtd file is for localization and so can remain as is without
affecting functionality.

I thought I would use #ifndef MOZ_THUNDERBIRD/#endif to comment out
the parts that is not supported by THUNDERBIRD (and I don't know much
about SpiderMonkey as of now.)
So I thought using MOZ_THUNDERBIRD was prudent.

(I have only compiled the binary of C-C TB
and using that binary WITHOUT INSTALLATION for testing.
This may matter to the problem I mention below.)

Anyway, I found out that preprocessing by mozbuild.preprocessor
seems to occur ONLY for
 - mail/base/content/mailWindowOverlay.xul
   -> preprocessed and copied into
   MOZ_OBJECT/bin/chrome/messenger/content/messenger/mailWindowOverlay.xul

mail/base/content/nsContextMenu.js is not preprocessed and
is referenced by a direct symlink from
MOZ_OBJECT/dist/bin/chrome/messenger/content/messenger/nsContextMenu.js

So placing #ifndef/#endif in nsContextMenu.js to comment out some
parts caused a loading error of the JavaScript file, I think, although
funnily, I didn't see the explicit loading error despite the strict
checking done by JS engine lately.  I only got suspicious by a later
error as follows:

JavaScript error: chrome://messenger/content/mailContextMenus.js, line
50: TypeError: gContextMenu is undefined

Can anybody enlighten me how to get this preprocessing done for
nsContextMenu.js as is done for
mail/base/content/mailWindowOverlay.xul ?

(To be honest I have no idea which files gets preprocessed and which
ones are not. Build infrastructure is not very intuitive.)

With the work-in-progress patch, I have removed the report phishing
URL menu from the context menu when one selects a URL in an HTML mail
successfully.

So the remaining issues are
 - finding out how to perform the preprocessing for nsContextMenu.js,
   and
 - finding out the correct changes to moz.build and others so that the
   build succeeds after files below phishing directory are removed.

TIA

--- end quote ---
_______________________________________________
dev-builds mailing list
dev-builds@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-builds

Reply via email to