• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Extension with nodejs, copyFileSync is not a function

Explorer ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

I can’t get Node.js to work – but I need filesystem access. I double and triple checked the manifest, documentations and existing threads...

I included enable-nodejs to the manifest and iFrame

Then I do

var fs = require(‘fs’)

but I get ‘copyFileSync is not a function’ when I try to use fs.

Any help is highly appreciated!

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Apr 04, 2018 Apr 04, 2018

Already solved it myself through the manifest. Make sure that

1. The tag <ExtensionManifest> and <RequiredRuntime> have the attribute Version="7.0"

2. Make sure the required <CEFCommandLine> tag with its child is within the <Resources> tag. In some Adobe examples it's wrong.

Votes

Translate

Translate
Guru ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

You  need mixed-content

<CEFCommandLine>

    <Parameter>--enable-nodejs</Parameter>

    <Parameter>--mixed-context</Parameter>

</CEFCommandLine>

From the md

Accessing nodejs APIs in iframe

nodejs symbols will not be available in iframe's global context, only way you can access nodejs APIs within iframe's context is through cep_node. When --mixed-context is enabled, global node symbols and cep_node is available within iframe's global context as browser and node gets executed at the same context. It is also important to note that, if you have existing code to check or use nodejs symbols in iframe's global context, it used to work till last release and in the current release, it breaks in separate context mode.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

Hi and thanks for your answer!

But even though I have both parameters defined, I just see for example CSEvent, CSInterface, VulcanInterface or cep in the global and frame context. I think I'm still missing something, but I have no clue...

It wouldn't have anything to do with me using jQuery and Angular...??

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 04, 2018 Apr 04, 2018

Copy link to clipboard

Copied

LATEST

Already solved it myself through the manifest. Make sure that

1. The tag <ExtensionManifest> and <RequiredRuntime> have the attribute Version="7.0"

2. Make sure the required <CEFCommandLine> tag with its child is within the <Resources> tag. In some Adobe examples it's wrong.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines