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
Videonow amp-ad debug ability #25217
Conversation
-- forwards parameters vn_debug and vn_module
-- changed demo profileId to 5555
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just recommendations. Ping me after you respond.
ads/videonow.js
Outdated
let customTag = null; | ||
const gn = global && global.name; | ||
if (gn) { | ||
const p = JSON.parse(gn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend
if (global && global.name) {
const p = JSON.parse(global.name);
Little bit of twisting needed to follow the logic here, though I think they are equivalent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ок
ads/videonow.js
Outdated
p.attributes._context.location && | ||
p.attributes._context.location.href; | ||
|
||
if (href) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, could do if (p && ...) {
here and then declare href
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
ads/videonow.js
Outdated
if (href) { | ||
const vnDataStorageKey = 'videonow-config'; | ||
const logLevelParsed = /[?&]vn_debug\b(?:=(\d+))?/.exec(href); | ||
const vnModuleParsed = /[?&]vn_module=(.*?)($|&)/.exec(href); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could do vn_module=[^&]*
so it always stops at the next &
and so it doesn't depend on the greediness of the search.
@powerivq |
@sdbaron I was wondering that. Can you explain your use case here? Why is logging to console not sufficient for debugging? There is a very high bar for using localstorage/sessionstorage for privacy concerns. |
It’s too difficult to explain all the processes inside our advertising module. I changed a couple lines of code and now there is no need to use sessionStorage. |
@powerivq Should I do something with this Missing required OWNERS approvals? |
@sdbaron nope. It'll pass once the PR is approved. |
@powerivq Hi! Should I do something else with this PR? |
Do you want me to merge? @sdbaron |
Yes please. I am not authorized to merge PR. |
@powerivq thanks a lot |
* -- change default URL of vn_init_module -- forwards parameters vn_debug and vn_module * -- add ability to set vn_init_module in the location url -- changed demo profileId to 5555 * -- some code style fixed * -- stop using sessionStore and localStorage * -- fixed code style in videonow.md * -- changed JSON.parse to parseJson * -- changed some code for pr rules
♻️ removed old code
✅ added ability to set vn_debug, vn_module, vn_init_module in the location url