javascript – Why are js libraries designed to load in iframe?

I'm developing a JavaScript library that users could include on their website. A common theme for all third-party libraries is that they are loaded into an iframe. (ex you tube) . Is there a specific reason for this to security point of view?

my library was originally designed to be loaded into iframe, but because of very special cases, I think the only way I have is to load it directly into DOM.

8 – Does the logic of the hook theme suggestions run on each page load and does this have an impact on the server load?

I've been working with Drupal for quite some time and I have a thorny question: does the logic in my * .theme or * .module files have an impact on the server load?

Let's say I have this piece of code in my * .theme file:

/ **
* Implements hook_theme_suggestions_HOOK_alter ().
* /
function MY_THEME_theme_suggestions_page_alter (array & suggestions, array $ variables) {

if ( Drupal :: routeMatch () -> getRouteName () == & # 39; entity.node.edit_form & # 39; &&  Drupal :: routeMatch () -> getParameter (& # 39; node) - > bundle () === & # 39; blog_general & # 39;) {
$ suggestions[] = & # 39; page__no_sidebars & # 39 ;;
}
}

This piece of code adds a template theme to page.html. I need it for only about 1% of my site and it bothers me a little that it is executed each page load, so that 1% of my site can be properly sized.

My question is this: would this code be executed each time a page is loaded? Or does caching occupy it? If it's running at every page load, this code can be trivial. However, I am building a lot of these types of modification hooks and I am afraid they will only tax the server.

I appreciate all the ideas. Thank you!

penetration test – How can I run the JS load?

So basically I'm trying to run my JavaScript scripts, but because of server-side filters such as htmlspecialchars he continues to fail.
Our entry is placed between this block of code:

Jagirao : My text goes here June 17 23:30X

How can I inject code? I've also tried various methods of the OWSAP cheat sheet, but they do not work. The site uses the utf-8 character set.

<becomes & lt; and> becomes & gt; only & # 39; survives.

Is it even possible to run js scripts under these circumstances?

Amazon Web Services – HTTPS only works with the Load Balancer DNS – AWS

I have a problem with HTTPS configuration on AWS, I hope you can help.

What I already have:

  1. EC2 – with elastic IP, open port capture with security group.
  2. Load Balancer attached to EC2 (with the same security group as EC2).
  3. SSL Certificate of AWS (ACM)
  4. Field – "Transferred", from another service (not Amazon) using only Elastic IP for DNS configurations. (Can this be the problem?)
  5. Route53 – configured for Field with AWS (SSL) and for the IPV4 address, I use an alias for Load Balancer.

How it works:

  • EC2: Elastic IP and Public DNS (only work for http) as it should work, I suppose.
  • LOAD BALANCER: Works and gives HTTPS and HTTP just access from the DNS name.
  • Route53 (Domain) – Works only for HTTP. Each HTTPS request returns ERR_CONNECTION_REFUSED.

How do i explain this problem for myself (if there is a problem, thank you for telling me this)
So if Field is redirected from the DNS settings to Elastic IP which is attached to EC2, there can not be an SSL connection because I use ACM for the SSL certificate, then LOAD BALANCER comes to get help for log on Field and SSLbut as in Areas DNS, there is no connection with LBS, AWS can not give SSL only Route53 configurations?

Will this solve the problem if I change the elastic IP address of EC2 in Domain DNS with the public DNS name of Load Balancer?

web – How fast should a website load?

I hear you asking for a simple answer. The best I can give you:

Feel faster than your competition – 20%

All basic research on system perception and responsiveness remains valid (for example, the basic scale of 0.1 / 1/10 seconds).

Check out this great summary of perception of performance, with ideas that could guide you. Like optimization for "just noticeable difference" (jnd).

It makes no sense to optimize for a number (load speed of Google Analytics) or a measure (stay away from the ranking versus the speed of a page). These are specific development tools that have virtually no connection to the big picture of user perceived speed.

If you are not able to put more gear in (and it will come), just remember the first heurestic of usability:

Visibility of the state of the system

and just ask for patience.

PS: Kissmetrics infographics are catchy, but offer very little real data. And coincidentally, comes first in the search for Google images for "How fast should a website load?" 😉

architecture – Is Google Cloud Load Balancer a single point of failure? Can we have a replica pending?

We are deploying our application in high availability in GCP for evaluation.
The raw architecture is similar toenter the description of the image here
(Image courtesy: Google cloud)

the The global load balancer itself appears as a single point of failure.

How can we achieve this goal in GCP.

  1. Can not find a high availability configuration for the Cloud Load Balancer in the GCP console.
  2. Googling brings me to the provision of backend services. Not what I'm looking for.

Can you please share your thoughts.

In python, I can not load an image in Tkinter

Hello friends, I try to load an image into a window with Tkinter in which I put this code that I saw in some tutorials. When I run the program, an empty window appears: S
so I've studied python accept images in .png or .gif format there will be a problem with the configuration of the image, or the version of python or tkinter ???

    from Tkinter import *

window = Tk ()
img = PhotoImage (file = juvia.png & # 39;)
widget = Label (window, image = img)

window.mainloop ()

I leave a picture of my window, thank you for your time !!!!
empty window when you try to open an image

7 – Unable to load css files with [‘#attached’] or drupal_add_css

I'm trying to attach multiple CSS files to a Drupal 7 module. All files have the same read / write / execute and owner permissions. I did not have a problem with one of the three files but I can not add the other two (check the loaded style sheets in the development tools). Here is what I tried:

<? php
function usspd_search_main_form ($ form, $ form_state) {
$ form['#attached']['css']['css1']    = & # 39; /sites/all/libraries/data_search/bootstrap_tagsinput/bootstrap_tagsinput.css&#39 ;; //failed
$ form['#attached']['css']['css2']    = & # 39; /sites/all/libraries/data_search/tagme/tagme_jquery-ui.css&#39 ;; //failed
drupal_add_css (& # sites; all / libraries / data_search / bootstrap_tagsinput / bootstrap_tagsinput.css & # 39;) //failed
drupal_add_css (& # sites; all / libraries / data_search / tagme / tagme_jquery-ui.css & # 39;) //failed

$ form['#attached']['css']['css3']    = drupal_get_path (& # 39; module & # 39; usspd_search & # 39;). & # 39; /theme/usspd_search.css&#39 ;; //works
return $ form;
}

My best guess is that there is a class conflict and that instead of replacing it, the attachment fails. Is it possible to declare priority? Otherwise, I will have to add the css files of the two files online.

In addition, I am able to call everything that goes satisfactorily when it is added as raw HTML to a basic page. This should not be a thorny problem.



High CPU load and memory

Discussion in the section 'Development, Databases, Hosting and Technical & # 39; started by ernesto roca, June 8, 2019 at 18:01.




  1. Ernesto Roca

    Ernesto Roca
    Community Veteran


    FSB Active Client


    joined:
    Jul 30, 2013
    posts:
    59
    I like receipts:
    1
    Trophy points:
    125

    Hi everybody
    I hope you are doing very well!
    I noticed a very high CPU load on my shared account.
    My host says is a sites using FSB
    Any suggestions on hot to reduce the load?
    Is it possible to use a cache plugin?
    My host uses litespeed and I know that litepseed has cache plugins:
    https://www.litespeedtech.com/products/cache-plugins
    thanks in advance!


    ernesto roca,
    June 8, 2019 at 18:01

    # 1

Share this page

windows 10 – My system becomes slow when the hard disk load is less than 100% of the load, even if it works on an SSD that is turned on ~ 5%

I've installed the system and all my main programs on SSD, but the memory is not just big enough for everything, so I use a hard drive in addition to my SSD.

The problem is that when I copy something to a hard drive, that I install games on this drive or any other item resulting in a 100% hard disk load, my system becomes really slow, even if the SDD is working really like 5 to 10%.

Does anyone have the solution to this problem?

System specifications:

Hard disk: WD 1 TB, 7200 rpm, 64 MB of cache (wd10ezex)
SSD: SSD SATA3 120GB Kingston A400 500 / 320MB / s
Processor: Ryzen 5 2600 @ 6C / 12T, 3.4-3.9Ghz
RAM: 8 GB, 2400 MHz
Motherboard: Asus Prime 350B-PLUS