How can I make a Chrome Extension that runs a Javascript command in console on a certain website?

How to Install Google Chrome Web Browser on CentOS 8?

How to Install Google Chrome Web Browser on CentOS 8?

This tutorial explains how to install the Chrome Browser web browser on CentOS 8. Chrome is the most widely used web browser in the world.

Chrome Browser is the most widely used web browser in the world. It is fast, easy to use, and secure browser built for the modern web.

Chrome is not an open-source browser, and it is not included in the official CentOS repositories.

This tutorial explains how to install the Chrome Browser web browser on CentOS 8.

Installing Chrome Browser on CentOS 8

Follow these steps to install Chrome Browser on your CentOS 8:

  1. Open your terminal and download the latest Chrome 64-bit .rpm package with wget:

    wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
    
  2. Once the download is complete, run the following command as root or user with sudo privileges to install Chrome Browser:

    sudo dnf localinstall google-chrome-stable_current_x86_64.rpm
    

When prompted, enter your user password, and the installation will continue.

At this point, you have Chrome installed on your CentOS system.

Starting Chrome Browser

Now that Chrome Browser is installed on your CentOS system, you can launch it either from the command line by typing google-chrome & or by clicking on the Chrome icon (Activities -> Chrome Browser):

When Chrome Browser is started for the first time, it will ask you whether you want to make Chrome your default browser and to send usage statistic and crash reports to Google:

Select the checkboxes according to your preferences, and click OK to proceed.

Chrome Browser will open, and you’ll see the default welcome page.

From here, you can sign-in with your Google Account to sync your bookmarks, history, passwords, and install Chrome apps and extensions.

Updating Chrome Browser

During the package installation, the official Google repository will be added to your system. Use the following cat command to verify that the file exists:

cat /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub

When a new version is released, you can perform an update with dnf or through your desktop standard Software Update tool.

Conclusion

In this tutorial, we’ve shown you how to install Chrome Browser on CentOS 8 desktop systems. If you’ve previously used a different browser, like Firefox or Opera, you can import your bookmarks and settings into Chrome.

If you hit a problem or have feedback, leave a comment below.

JavaScript SEO - How Google Search Indexes JavaScript Site

JavaScript SEO - How Google Search Indexes JavaScript Site

JavaScript SEO - How Google Search Indexes JavaScript Sites. Learn how Googlebot handles JavaScript when crawling, rendering and indexing. Learn how JavaScript influences SEO and how to optimize your JavaScript-powered website to be search-friendly.

Martin Splitt, Webmaster Trends Analyst, explains how JavaScript influences SEO and how to optimize your JavaScript-powered website to be search-friendly.

JavaScript Tutorial: if-else Statement in JavaScript

JavaScript Tutorial: if-else Statement in JavaScript

This JavaScript tutorial is a step by step guide on JavaScript If Else Statements. Learn how to use If Else in javascript and also JavaScript If Else Statements. if-else Statement in JavaScript. JavaScript's conditional statements: if; if-else; nested-if; if-else-if. These statements allow you to control the flow of your program's execution based upon conditions known only during run time.

Decision Making in programming is similar to decision making in real life. In programming also we face some situations where we want a certain block of code to be executed when some condition is fulfilled.
A programming language uses control statements to control the flow of execution of the program based on certain conditions. These are used to cause the flow of execution to advance and branch based on changes to the state of a program.

JavaScript’s conditional statements:

  • if
  • if-else
  • nested-if
  • if-else-if

These statements allow you to control the flow of your program’s execution based upon conditions known only during run time.

  • if: if statement is the most simple decision making statement. It is used to decide whether a certain statement or block of statements will be executed or not i.e if a certain condition is true then a block of statement is executed otherwise not.
    Syntax:
if(condition) 
{
   // Statements to execute if
   // condition is true
}

Here, condition after evaluation will be either true or false. if statement accepts boolean values – if the value is true then it will execute the block of statements under it.
If we do not provide the curly braces ‘{‘ and ‘}’ after if( condition ) then by default if statement will consider the immediate one statement to be inside its block. For example,

if(condition)
   statement1;
   statement2;

// Here if the condition is true, if block 
// will consider only statement1 to be inside 
// its block.

Flow chart:

Example:

<script type = "text/javaScript"> 

// JavaScript program to illustrate If statement 

var i = 10; 

if (i > 15) 
document.write("10 is less than 15"); 

// This statement will be executed 
// as if considers one statement by default 
document.write("I am Not in if"); 

< /script> 

Output:

I am Not in if
  • if-else: The if statement alone tells us that if a condition is true it will execute a block of statements and if the condition is false it won’t. But what if we want to do something else if the condition is false. Here comes the else statement. We can use the else statement with if statement to execute a block of code when the condition is false.
    Syntax:
if (condition)
{
    // Executes this block if
    // condition is true
}
else
{
    // Executes this block if
    // condition is false
}


Example:

<script type = "text/javaScript"> 

// JavaScript program to illustrate If-else statement 

var i = 10; 

if (i < 15) 
document.write("10 is less than 15"); 
else
document.write("I am Not in if"); 

< /script> 

Output:

i is smaller than 15
  • nested-if A nested if is an if statement that is the target of another if or else. Nested if statements means an if statement inside an if statement. Yes, JavaScript allows us to nest if statements within if statements. i.e, we can place an if statement inside another if statement.
    Syntax:
if (condition1) 
{
   // Executes when condition1 is true
   if (condition2) 
   {
      // Executes when condition2 is true
   }
}

Example:

<script type = "text/javaScript"> 

// JavaScript program to illustrate nested-if statement 

var i = 10; 

if (i == 10) { 

// First if statement 
if (i < 15) 
	document.write("i is smaller than 15"); 

// Nested - if statement 
// Will only be executed if statement above 
// it is true 
if (i < 12) 
	document.write("i is smaller than 12 too"); 
else
	document.write("i is greater than 15"); 
} 
< /script> 

Output:

i is smaller than 15
i is smaller than 12 too
  • if-else-if ladder Here, a user can decide among multiple options.The if statements are executed from the top down. As soon as one of the conditions controlling the if is true, the statement associated with that if is executed, and the rest of the ladder is bypassed. If none of the conditions is true, then the final else statement will be executed.
if (condition)
    statement;
else if (condition)
    statement;
.
.
else
    statement;


Example:

<script type = "text/javaScript"> 
// JavaScript program to illustrate nested-if statement 

var i = 20; 

if (i == 10) 
document.wrte("i is 10"); 
else if (i == 15) 
document.wrte("i is 15"); 
else if (i == 20) 
document.wrte("i is 20"); 
else
document.wrte("i is not present"); 
< /script> 

Output:

i is 20