Skip to content

triggerExport is not defined (firefox 61) #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
shigatsuverame opened this issue Jun 18, 2018 · 1 comment
Open

triggerExport is not defined (firefox 61) #18

shigatsuverame opened this issue Jun 18, 2018 · 1 comment

Comments

@shigatsuverame
Copy link

shigatsuverame commented Jun 18, 2018

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();
            };
@xmhubj
Copy link

xmhubj commented Jul 13, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants