« first day (3321 days earlier)      last day (1610 days later) » 
00:00 - 22:0022:00 - 00:00

12:06 AM
Is it possible to use window.location.replace() on an iframe with an external script?
 
@VenesemeTyras Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@VenesemeTyras do you mean just changing the arc attribute of the iframe?
 
window.location.replace(thispage.html#anchor) can target on-page anchors without reload, and without history.
If it's an iframe though, I can't make it work with external script. works inline onclick. works in console. but not via external script.
 
 
1 hour later…
1:28 AM
hey..lets say you have an Angular app which hosts Angular Elements (web-components).
Can you prevent the web-components from change the window.location.href of the Angular app?
I've come across this bug today where we had a child app re-route our Angular app
 
in AngularJS you don't use window, you use $window or $location
I don't know if it's the same in Angular 2+
but if it is you could always find a way to change what gets injected for those
otherwise you might have to just overwrite the window.location object
 
hmm ok, they could also be vanillajs web-components
in that case they have access to the window object
I guess I can't prevent them from changing location then?
 
well if they're vanilla web components then I don't see why overwriting window.location wouldn't do the trick
of course that's a really messy solution but it should do it
 
6
A: Is it possible to overwrite window.location function with a custom function?

Jared FarrishI don't believe you can reassign window.location. From MDN: Summary Returns a Location object, which contains information about the URL of the document and provides methods for changing that URL. You can also assign to this property to load another URL. https://developer.mozill...

 
It is possible to use __defineGetter__ to override window.location in some browsers although I don't recommend it. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…dansomething Feb 20 '15 at 16:23
 
1:33 AM
ok so the Angular app would overwrite the window.location during bootstrap
 
I mean it's kind of awful but
that should do it
the better solution would be to just not use that component
or submit a PR or something
 
will look into that as an option
we will have to use the component but I can advise devs to not change the location I guess
 
So no one here knows about using javascript window.replace.location() on an iframe? See my question just above...
I posted a question about this several days ago, no answers... Would greatly appreciate a little help, if anyone has a bit of time look into it.
0
Q: window.location.replace for iframe?

Veneseme TyrasWe can use window.location.replace to avoid history, and to target on-page anchors without page reloads, but not in iframes? The problem is a CSP (content security policy) violation, which states script-src 'unsafe-inline' must be enabled. Except I don't have a CSP defined, and even if I define ...

 
 
5 hours later…
6:23 AM
I think you've answered your own question
No one here knows
 
 
1 hour later…
7:26 AM
@VenesemeTyras there are several security measures put in place for iframes regarding window location
this includes but isn't limited to, the iframe being able to know anything other than the fact that it is an iframe and the parent not being able to know anything about the iframe if the iframe navigates elsewhere
sounds like an XY problem to me. You should be asking yourself what your goal is, and go from there
 
 
3 hours later…
9:59 AM
@forresthopkinsa LOL nobody knows
 
one of the great mysteries of the universe
behind the illuminati and the templars
 
operate from the shadow. Follow the creed!
 
10:17 AM
Hey
So I've included an Angular Elements component as a bundle file in am Angular app
And unlined the source maps..But when I debug I still only see the minified source for the component
Shouldn't including the source maps in the bundle file allow you to debug / step into each file that makes up the component?
Or am I crazy?
 
@BrianJ there's an experimental feature in chrome which lets you "unminify" code
it's of course not the same as having the original unminified version, but it helps
 
@geisterfurz007 that guy had some balls to post that as an answer :P
 
I had pretty much the same thought though. Just put a snippet of someone saying flex seal there and boom! Answer done :D
I wouldn't be surprised if it was removed sooner or later but for now, that is a solid display of balls, yeah :D
 
not even sure that would be a good solution to the problem
if there's a bolt in the way
 
10:33 AM
You'd just spray way too much of that stuff onto and around that bolt, done.
 
it'd also have to work instantaneously
 
Have you seen what Phil Swift can do with Flex Tape and Seals?
If you had, you would not question allmighty Flex-products c:
 
@geisterfurz007 i am curious why non-stainless steel bolts got used
 
Old building
 
that must be 50+ years
 
10:41 AM
I love those infomercials though
my favorite are usually the ones with the knives where they cut through cans and tomatoes and whatever else
 
still, that is an easy quick fix for me
just get your hand dirty. Or get a new pot
 
you'd have to saw off the bolt
and with the water leakage, probably not a job for a housewife
it would just be a pain but you could do it
 
a saw? wtf
 
it's a freakin' rusted bolt
what would you propose?
 
Does some of you already use tailwind with webpack ?
 
10:47 AM
use a rust dissolver or acetone to reduce the friction so that you can jack 'm out
if it is hard to reach, I have a torch for that
 
I didn't know that rust dissolver was a thing
 
or a nut splitter for easy-to-access one if the first step failed
I don't have one tho.
 
probably wouldn't be a good idea if it was attached to a porcelain toilet
 
Nutsplitter sounds really, really, really painful.
 
11:03 AM
posted on November 19, 2019 by Michaël Zasso

Notable changes Experimental support for building Node.js with Python 3 is improved. ICU time zone data is updated to version 2019c. This fixes the date offset in Brazil. Commits [56be32d22d] - async_hooks: only emit after for AsyncResource if stack not empty (Anna Henningsen) #30087 [e16e3d5b90] - benchmark: remove double word "then" in comments (Nick Schonning) #29823 [dcdb96c7bb

 
 
2 hours later…
12:49 PM
Anyone know why I cant use DataURLs in a Window.open() statement?
I remember making a micro bookmark with a website embedded in a window.open() function using a dataURL, and it used to work fine
I forgot what I did, but now when I do it, it just opens about:blank
 
You sure you're formatting it right?
 
Yes... Im using my DataURL converter to make the URL
which pasting in the URL bar works perfectly
opens my page
but pasting it inside the "" string for the URL does nothing
just open about:blank
 
i don't believe you
 
okay, now check your new window's console
and search that error
 
12:55 PM
Bruh
"Now allowed to visit data URl" what is this bullshit
 
it doesn't say that
but okay
 
I used a data URL in window.open less then a year ago
Not allowed to navigate top frame to data URL
Thats what it says
Pretty much the same thing :L
 
it's disabled for security reasons
 
are you fking kidding me... God these stupid security restrictions are startin to piss me off
 
> hack me pls
 
12:57 PM
They might as well as block javascript one day..
 
I wish they would, then you'd have no reason to be here
 
ouch.
:L
Ill just bypass it with iframes then... sigh
 
@BenFortune 😅
and perhaps /inbefore iframe blocking due of s.o.p.
 
function debugBase64(base64URL){
 var win = window.open("","targetname","height=200,width=200");
 win.document.write('<iframe src="' + base64URL  + '" frameborder="0" style="border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;" allowfullscreen></iframe>');
}
found that
Looks like someone else had a similar problem to mine
 
that wouldn't work on my web pages.
 
1:05 PM
Its for a bookmarklet :(
Im tired of opening codepen or GH pages to convert files to dataURLs
too lazy to manually convert with chrome devtools
Ok, I finished it, anyways, sorry for being an annoying piece of shit lol :3 Ill get out of your guyses hair.
 
1:23 PM
@Neil Well, it isn't really an XY problem because on the question that I linked I outlined exactly what I was trying to do. Target anchor links in an iframe without page reload and without history. I don't mean scroll to the anchors, the page doesn't need to scroll, there is an example included on the question I linked. window.location.replace works in the console, it works inline, not in external script which seems. iframe on same domain/port/protocol. Same sub/domain/protocol.
 
I think it doesn't matter if it is the same domain or not
you can't really navigate away from the initial page and still have control over it
 
okay, but I am not trying to read from the parent page (though I can, and other scripts do). And I can do what I'm trying with inline script, and in the console. Just not with external script...
 
 
3 hours later…
4:16 PM
Hello world. Can a web extension figure how much data has been downloaded from a particular tab?
 
@deostroll maybe? You'd have to tap into some browser api or proxy every request through either an external fake vpn, or your own function of some sort
@TaylorS If you use Tor, it is suggested.
 
That is a good idea, though, see how much network usage a single site uses, like facebook
 
The best way i could think of is the fake proxy idea.
But that requires a desktop app as well.
@deostroll If you want to go that route look into the data counters for iOS, they setup a vpn to localhost where their app listens, counts data, and then forwards the request normally.
 
4:53 PM
1
Q: pass forwardRef via cloneElement reactjs

Dhanush Balaconst ref = useRef() React.Children.map(this.props.children, (element) => { React.cloneElement(element, { innerRef: node => ref, }) }) here element is a component like the following const newComponent = forwardRef(({children, ...otherprops}, ref){ return ( ...

 
5:29 PM
Not sure if this is an intended feature, but Dat.GUI DOESNT RETURN FALSE WHEN UNCHECKED....
Heres a basic checkbox detection code for dat.gui:
 if (datObject.Check) {
  console.log(datObject.Check);
  if (datObject.Check = true) { // detects if the returned value is a change from the Checkbox
   // Do something if its Checked
   CheckOutput.innerHTML = "Checked";
  } else if (datObject.Check = false) {
   // Do something if its Unchecked
   CheckOutput.innerHTML = "Unchecked";
  }
 }
You can set a checkbox to false in the defaults code above the GUI, and it sets it unchecked, but its returning True when checked, but console logging it when its unchecked... it returns nothing...
like what??
codepen.io/SkylerSpark/pen/LYYqWrM I was making a small Sample Code for a friend, and then All the sudden this happened? Ive never had dat.gui not return a value like it should
Ive used dat.gui many times in the past, and its never done this
 
else if (datObject.Check = false)
smh
 
else {} was returning nothing too
Im console logging the value of datObject, so the if statement isnt even the problem
 
You're missing a second (and third) equals symbol
you're setting the value
mega wrong
 
ndugger, again, it doesnt log false, so its not giving me an output in the first place
 
Don't even use equals for checking boolean values
Fix one bug at a time. Right now, all I see is some blatantly incorrect code
Fix that first, then we'll talk about your missing logs
 
5:34 PM
 if (datObject.Check) {
  console.log(datObject.Check);
  if (datObject.Check == true) { // detects if the returned value is a change from the Checkbox
   // Do something if its Checked
   CheckOutput.innerHTML = "Checked";
  } else {
   // Do something if its Unchecked
   CheckOutput.innerHTML = "Unchecked";
  }
 }
Happy? Same issue still occuring
It doesnt return false, but it doesnt return a change either
 
My happiness is irrelevant. I also don't see any console.log in there
 
it will send "true" when you check it, but its like the GUI isnt detecting a change in the checkbox if you uncheck it
 
oh wait
I'm blind
 
line 2: console.log(datObject.Check);
same, Im -18 in both eyes, except im actually literally blind
 
No idea which library you're using in JS that uses pascal casing for properties
 
5:36 PM
dat.Gui.min.js
popular controller library
It normally returns false
Im so confused today
when you set a default value to true or false in your defaults in dat.gui, it automatically adapts to be a checkbox
but its not functioning like it should
this.Check = false;
 
Where are the docs that talk about the .Check property?
 
Its not a property
its the name of my Checkbox
codepen.io/SkylerSpark/pen/LYYqWrM Its confusing at first, but basically, you create your own properties
 
Your checkbox is a boolean value, and not an actual checkbox? Wtf?
 
the gui is just a framework
Yeah, the gui visualizes all true/false booleans as checkboxes
This is the actual checkbox object itself:
datGuiFolder1.add(datObject, "Check").name("CheckBox").onChange(datValue);
 
the codepen works for me
 
5:39 PM
"Check" is the object name, .name is the visual text that appears, and onChange is.. well.. that should be obvious
 
when it's true, I see true logged in the console
 
Yeah, but no false
when unchecked
brb switching classes
 
Where's your code to log false?
You don't have any code that would ever log false
 
@JBis @ndugger Me thinks. I got it...on chromium or google chrome there is a performance object attached to window...I got it from here
 
I knew about the performance object, I just am not familiar with what properties exist on it. Great find.
 
6:09 PM
I have a select control in a Vue page. The control doesn't use a model and I'm trying to set the initial value selected.
        <select v-on:change="expandToLevel($event.target.value)">
            <option v-for="i in maxLevel" :value="i" :selected="i == maxLevel ? true : false">{{ i + (i == 1 ? ' Collapse All' : ( i == maxLevel ? ' Expand All' : ''))}}</option>
        </select>
maxLevel is an integer
The whole control creation craps out and the select ends up without anything in it
If I remove the :selected attribute it gets created just fine.
 
don't you think that i == maxLevel ? true : false is a bit redundant?
 
Yeah, that was the last thing I added without thinking from the last help page I googled
Meant to delete that before I came here
 
I don't know vue, though, so I can't actually help you
 
Fuck. Never mind.
 
6:57 PM
"maxLevel is an integer"
v-for is for iterables
 
7:18 PM
Hello
anyone know angular here
I have some questions
 
ish
 
7:32 PM
@JayB Yeah, and if you put an integer in there it will automatically create an int array from 1 to whatever number that is.
 
|| welcome azam
 
@azam Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
ok @JamesBot
 
Hello guys, maybe you can help me. I want to do a service that gets triggered every month from the cloud automatically. What can I use to do this?
 
wdym by "do a service"?
"from the cloud" - Google Cloud, AWS, Azure are all good cloud platforms. I suggest GC because of their $300 free credit
"triggered every month" - Use cron for this
 
7:43 PM
I have just seen some scheduler from AWS
But it is just possible to be used with js?
Actually my program will do every month a request and will do some actions, but won't be a service (it won't be listenning)
 
I would suggesting doing OS level like cron but you could do setInterval/setTimeout, but it won't be 100% accurate
 
I don't mind about precision, is just to automate an action I do manually with a monthly email
 
No, no, no, don'y have a server running the entire month, just to do something once
That's a massive waste of resources
 
What would be the best approach?
 
some kind of serverless function, like AWS's lambda service
 
7:48 PM
maybe I can just run it from my computer?
 
That way they carry the cost of the server, and you just pay to have your function run once a month
 
it is an easy action. But I want to be automatic
 
AWS Lambda, GCP Cloud Functions
 
Yes @ndugger is right. Unless you have a different service already, use something like those. I'm saying if you already have a vm you can use cron, etc.
 
No
 
7:49 PM
It is more to practice with the cloud, than the action itself :D
So, best approach is an AWS Lambda. Right?
 
Are you already using a cloud service?
If you're not already using AWS I'd go with GCP, personally
IMO AWS is a PITA
 
i think the same of GCP
 
As a tie breaker, GCP > AWS (for usability, not for cost)
 
At work we use AWS, but I do not do this kind of work, so I would like to learn
 
To be fair, I haven't even attempted to use AWS in a few years now, so maybe it's a lot more user friendly than it used to be
but I doubt it
 
7:54 PM
it doens't look any different to me than it did a few years ago
What didn't you like about it?
 
Honestly, I was still learning server/cloud stuff, and I just could not wrap my head around anything in AWS' dashboards and all that. I was able to figure out GCP in a matter of hours
 
yeah last time I used AWS it was a major pain point to do something very simple
 
I think it really just boils down to how much of AWS do you actually need
like, you could go all out and automate all kinds of shit
 
probably
 
or...
you could just have an ec2 container and not care about the rest of it
 
7:56 PM
I think my solution is AWS Lambda
 
we do the latter
 
that works
I've worked with a lot of separate parts of GCP and everything comes together pretty nicely
 
Is there a reason AWS seems to be generally regarded as superior than GC? I say this as the DoD didn't even consider GC it was between AWS and Azure.
 
That was probably my problem. AWS offered so much, that I didn't even know where to start
GCP was still pretty small when I started out, so I was able to wrap my head around their offerings
 
@JBis it's because AWS has a privacy certification that GCP does not
 
7:58 PM
right, like, there's a ton of tools. we use ec2, s3, ses, and we use a "solution" that they built from us from a template that uses cloudwatch, rds, and lambda to start/stop servers on a schedule
 
basically because the certification is arbitrary and crazy expensive
neat
 
we moved to them from godaddy, GCP wasn't a thing at the time
neither was azure
 
Azure is even more confusing
 
@forresthopkinsa Interesting. For $10 Billion I would think Google would make that investment.
 
afkmeeting
 
8:07 PM
My dad once asked me to make a web site for an old friend of his to sell his music from (yes, I told him about places like CD Baby, he didn't care. He wanted to sell directly from his own personal site linked to PayPal). I didn't ask for much. The one thing I asked when he needed to set up hosting was to NOT use Godaddy. I gave him a bunch of alternatives. Three guesses as to what hosting service he picked.
Oh, and he insisted on a domain name that did NOT have his name it, but was only a description of the genre of music he performed.
 
lol
client is always right
 
I was getting $100 for it
Which I didn't actually care about
Actually, no. Not even the genre. The nationality.
 
@Hypersapien What payment gateway did you use instead of paypal?
 
No, we used paypal.
I'd be surprised if he got a single order from it, and if he did I wouldn't be surprised if he never actually found out about the orders to mail the CDs out.
 
8:57 PM
I am new to angular and I am designing a treeview where every subject should have edit button based on logged in user.
Now how should I check for the loggedin user? or should I have a component for that edit button?
 
9:17 PM
Will it be a different button or will the button not be there depending on the login?
Not that I know anything about Angular
 
depending on the login
if the user is not logged in the edit button should not be there
@Hypersapien
 
If the user is logged in does the button contact the server?
 
the edit button then loads another subject edit page
just a link
 
I'd just hide it, but on the edit page make sure a user is logged in before sending anything to the browser.
 
how do you hide it?
what condition do you check here? that is what I am asking
@Hypersapien
 
9:29 PM
Does the front end know anything about the login session state?
 
do you know angular?
 
Do you send anything there? The way logins are stored is going to be specific to your site.
> Not that I know anything about Angular
 
then don't waste my time
 
But it seems like a question that isn't specific to angular
 
38 mins ago, by azam
I am new to angular and I am designing a treeview where every subject should have edit button based on logged in user.
Now how should I check for the loggedin user? or should I have a component for that edit button?
> I am new to angular
> asking for help for free from volunteers
> don't waste my time
BS attitude my man
 
9:44 PM
knowing the framework/lib is rarely a requirement for being able to assist when it comes to javascript
 
Hi guys, I don't want to be a pest, but I would really like to know why this works inline onclick, and it works in the console, but not in a .js file...
https://stackoverflow.com/questions/58849390/window-location-replace-for-iframe
 
sorry, i don't want to touch that one : /
Other than to say, maybe... just maybe, you're taking a the long scenic route to get to your end result
If all you're trying to do is scroll the page (or an iframe) down to a particular anchor, without affecting history... the best route might be to not use the #
 
iframes and CSP and programmatic location changes.... nightmare fuel
 
just scroll it
 
asking does not mean i am worthless
@forresthopkinsa
 
9:57 PM
noone said you are worthless
 
@azam I think that there's a language barrier that's damaging our communication
 
okay
 
if they did that woulda been flagged quite quickly
 
If you run the snippet, you can see there is no scrolling involved
 
I'm not questioning your worth, I'm saying that your statement "don't waste my time" was rude, and it's unwise to be rude to people who are volunteering to help you
 
9:59 PM
> the input value is not automatically validated to a particular format before the form can be submitted, because formats for telephone numbers vary so much around the world.
Laughs in Native
 
00:00 - 22:0022:00 - 00:00

« first day (3321 days earlier)      last day (1610 days later) »