Skip to content
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

override default fun-hooks module configuration #4024

Closed

Conversation

ghost
Copy link

@ghost ghost commented Jul 25, 2019

Type of change

  • Bugfix
  • Feature
  • New bidder adapter
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Does this change affect user-facing APIs or examples documented on http://prebid.org?
  • Other

Description of change

Possibility to overwrite default fun-hooks module configuration used by Prebid.js while importing them.

Need to change default useProxy value of fun-hooks configuration https://www.npmjs.com/package/fun-hooks#configuration in some cases.

Example:

$$PREBID_GLOBAL$$.hookSettings = {
  useProxy: false
}

@ghost ghost changed the title overwrite default fun-hooks plugin configuration overwrite default fun-hooks module configuration Jul 25, 2019
@ghost ghost changed the title overwrite default fun-hooks module configuration override default fun-hooks module configuration Jul 25, 2019
@snapwich
Copy link
Collaborator

Can I ask why you'd want to disable the use of Proxy?

@ghost
Copy link
Author

ghost commented Jul 26, 2019

Can I ask why you'd want to disable the use of Proxy?

Hi,
some of the pages where I use Prebid.js to display video overrides global Proxy class. This is caused by PureMvc framework, embedded in video player iframe which I use, for example: https://tinyurl.com/y2ga4e56
I have this problem with a lot of services and this small change is the best option for me to handle this issue.

@snapwich
Copy link
Collaborator

closing in favor of #4030

I'd rather not have fun-hooks be configurable through Prebid.js mainly because it has to be configured before loading (as you noticed) which is user-unfriendly and requires hacky solutions outside of the standard pbjs.setConfig().

However, this really is a problem in determining whether or not Proxy is actually the native Proxy. I updated the fun-hooks library to do a check for Proxy.revocable which is part of the Proxy API (which the Proxy global made by PureMVC is not), so this new check should fail on your page and it should fall-back gracefully to the non-Proxy hooks.

@snapwich snapwich closed this Jul 26, 2019
@ghost
Copy link
Author

ghost commented Jul 31, 2019

Thanks for your help, now everything works fine.

@wsusrasp wsusrasp deleted the overwrite-fun-hooks-default-config branch May 20, 2024 12:25
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

Successfully merging this pull request may close these issues.

2 participants