har-export-trigger icon indicating copy to clipboard operation
har-export-trigger copied to clipboard

triggerExport is not defined (firefox 61)

Open shigatsuverame opened this issue 6 years ago • 1 comments

I keep encountering this triggerExport is not defined error when i'm trying to execute my automation using selenium in getting the HAR files. Does anyone here have worked with HAR + Selenium using Firefox 61?

Here's my setup Selenium 2.53.0 Geckodriver v1.19.1 Firefox 61.0b13

Here's my file.py def create_har_file(self, log_path=getcwd()): script = ''' function createHAR() { var options = { token: "careengine", fileName: "CE_HAR %Y, %H:%M:%S" // Name of the file };

                HAR.triggerExport(options).then(result => {
                    // The local file is available now, result.data is null since options.getData wasn't set.
                });
            };

            // If HAR isn't yet defined, wait for the `har-api-ready` event.
            // Otherwise trigger the export right away.
            if (typeof HAR === 'undefined') {
                addEventListener('har-api-ready', triggerExport, false);
            } else {
                createHAR();
            };

shigatsuverame avatar Jun 18 '18 07:06 shigatsuverame

From the way in your code, looks like you are still using the old HARExportTirgger addon, which no longer work on FF 57 or later.

You have to use the new addon based on web-extension specification in this repository. Also please read the usage in the readme file.

xmhubj avatar Jul 13 '18 08:07 xmhubj