How to make v8 generate a log file? - v8

I have compiled chromium with the command make chrome BUILDTYPE=Release.
Now I wish to make v8 generate a log file, I have found this page that suggest
out/ia32.release/d8 --prof script.js
I have a folder "Release" in my out folder, but in that folder I don't have a folder named "ia32.release" or "d8".
What should I do ? Thanks in advance for the help!

d8 is a stand-alone V8 debugging shell. Since you built Chromium, presumably you want to profile your application running in Chromium. In this case, you don't need d8 as you can simply use --js-flags command-line option as documented in Profiling Chromium With V8 and Run Chromium with flags.

Related

Open Firefox with a temporary add-on on startup

Is there a way in which I can open Firefox and force it to load a temporary add-on (webextension) on startup? Normally I have to manually go to about:debugging and select the extension on my hard drive. I'm looking for a flag I can pass when I load Firefox so that this is done automatically.
If this is not possible, is there a recommended extension I can install to simulate that a user opens this URL and adds this extension?
Yes, you can use the command web-ext run from the directory in which the extension exists. This will start Firefox with the WebExtension installed using a temporary profile. web-ext run is intended for testing your WebExtension add-on during development, not for normal use of Firefox. By default, the web-ext run command will watch your WebExtension's files and automatically reload the extension when any of the files are changed. You can disable this feature by using the --no-reload option.
If you are using a Firefox version below 49, you will need to specify the --pre-install option which uses a different method of installing the extension in the profile. However, if you use the --pre-install, your WebExtension will not be operational if you are trying to use a release or beta version of Firefox and the extension is not signed. This basically means that using --pre-install is not useful for Firefox versions below 49 unless you are using a Developer Edition build. Using --pre-install can be useful for Developer Edition versions of Firefox above 49 if you are wanting to test how your extension behaves during Firefox startup. If you do not use the --pre-install option, your extension is installed as a temporary extension and does not need to be signed to be tested in release versions of Firefox.
If you want to use a specific profile, then you need to specify the profile using the --firefox-profile option. MDN says:
When using a custom profile, web-ext first copies the profile. The custom profile will not be altered.
Installing web-ext
You will need to install web-ext. You can do so by following the instructions in Getting started with web-ext. The instructions are to, after you install node/npm, run the following command:
npm install --global web-ext
References
Getting started with web-ext
web-ext command reference

How to build firefox as installer

Now I'm trying to build firefox according to https://developer.mozilla.org/en-US/docs/Simple_Firefox_build
So I can get firefox from mozilla-release\obj-i686-pc-mingw32\dist\bin folder.
I want to get setup.exe from this result.
How can I build firefox as installer type.
./mach build installer is both the official way to build a Firefox installer, and the way that worked for me.
Note: it will put the installer in mozilla-release\obj-i686-pc-mingw32\dist\install\sea\firefox-36.0a1.en-US.win32.installer.exe (where “36.0a1” is replaced whatever version you're compiling.
Note 2: You may need to add the line mk_add_options WIN32_REDIST_DIR="$VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT" (or similar) to your .mozconfig to build a version that installs on non-developer’s computers. This part didn’t actually work for me. :(

SDL_Image IMG_Load fails on png with: "Failed loading libpng16-16.dll:"

Whenever I try to load a PNG using SDL_Image's IMG_Load function it gives the error Failed loading libpng16-16.dll:. I have all the right dll's in the right path and I can use other parts of SDL_Image, but for some reason it can't load the libpng dll. How can I fix this? Any help is appreciated.
It appears that libpng16-16.dll has a dependency on zlib1.dll for MinGW-w64 (32-bit). Try to include zlib into your dependnecies--include the DLL in the folder where the executable runs.
See my article "SDL2: Loading Images with SDL_image":
If you're going to run from Visual Studio, make sure the image is in the same folder as your main.cpp file; otherwise if you're running straight from the executable, the image should be in the same folder with it.
Needless to say, what I wrote about the image here goes for the DLLs as well.
The VS do not searches dlls on anywhere except the execution dir, so you probably need to copy that dll to the Debug/ directory on your solution's path.
Very niche answer, but for those running into this issue because of pySDL2, it could be caused because your python interpreter is sub-par. For me, using the windows store install for python interpreter 3.10, gave this issue. However, when I switched to 3.10 from python.org all my issues were fixed.
This link show you how to set up SDL library/libpng16-16.dll to be available for acceess by the compiler.exe (the last step right before the sample code)
yourProgram proprety page -> Builds event-> post-build event
in my case i have
copy “C:\Users\MehdiB\Desktop\C Program\Library\SDL2-devel-2.0.4-VC\SDL2-2.0.4\lib\x86\SDL2.dll” “$(OutDir)SDL2.dll”;
copy “C:\Users\MehdiB\Desktop\C Program\Library\SDL2_image-devel-2.0.1-VC\SDL2_image-2.0.1\lib\x86\SDL2_image.dll” “$(OutDir)SDL2_image.dll”;
copy “C:\Users\MehdiB\Desktop\C Program\Library\dll\libjpeg-9.dll” “$(OutDir)libjpeg-9.dll”
here where you can get this dll
i just replaced zlib1.dll in system32 and SysWOW64 with the one downloaded from
https://github.com/OctaForge/OF-Windows/blob/master/bin_win32/zlib1.dll
.and worked nicely

Package executables along with Firefox addon

My addon requires to run certain exes and hence I used to package the exes alongwith my addon and put them under the content dir. At the time of running the exe, I used to access the executable by going to <ProfileDir>/extensions/<addon-unique-id>/content/ dir.
While I was trying to make my addon compatible with FF 4, i figured out that now the extensions do not get expanded into a directory under extension/ dir; rather a <addon-unique-id>.xpi file is present there.
Can someone tell me how can I access my exes now?
Thanks
Kapil
You can have it unpack still by adding a line to your install.rdf file.

Install Firefox extension using windows registry

I have followed the instructions here [MDC - Adding Extensions using the Windows Registry],
but haven't been able to get Firefox to automatically install my extension when I restart it.
I have written an application that is half windows service and half FF extension. I have built an installer and want it to be able to install the Firefox extension along with the service.
So far I have tried the following things:
Removing my dev version of the
extension from FF first
Removing the
pointer file to my dev version of the
extension from my profile dir
Removing my "dev" profile completelly
so that FF only has a "default"
profile
Running FF without the
-no-remote and -P switches I setup for the dev environment
Trying the
key in both HKEY_CURRENT_USER and
HKEY_LOCAL_MACHINE
Carefully checking
the ID and Paths I have used
Trying
Paths that don't include spaces
Trying the Paths in Quotes
Trying a
trailing \ at the end of the path
Trying the .xpi filename at the end of the path instead of just the dir name
Building the XPI using the Extension
Builder plugin instead of manually
(although my manual build would
install just fine if I dragged it to
FF)
I'm using FF3.5.2 on Windows 2003 Server
(could it be a W2K3 install security issue?)
UPDATE: Now tested also on WinXP FF3.0.11. Same problem.
OK. I figured it out myself! I miss-read one line of the instructions!!!
"the location of the unpacked XPI"
I must be losing my mind. For some reason I reread this as the "packed XPI" over and over!!!
(I feel very silly now)
The answer was to use the unpacked files in the install dir not the .xpi file.
I noticed that it's really important to have back-slash in the file path, ex: [TARGETDIR]Extension\Firefox\

Resources