Viper
Viper

Reputation: 1397

PHP Google Extension

I'm looking to create a Google Extension for Chrome. I was wondering if it is possible to include a PHP file in the extension. After reading about extensions on Google's developer portal, they only mentioned HTML, CSS, and JavaScript. Nevertheless, is it possible to use PHP in the extension? Help is greatly appreciated.

Upvotes: 0

Views: 327

Answers (3)

Frank Jose
Frank Jose

Reputation: 476

The google extensions only support HTML, CSS and Javascript files and this is what is considered a client, while PHP is a server-side language.

Architecture of a google chrome extension with PHP as REST API

You can find more about Google Extensions here https://developer.chrome.com/docs/extensions/mv3/architecture-overview/

Upvotes: 0

josh
josh

Reputation: 10338

No. Well, you can include a PHP file, but it won't be processed because PHP is run on a server. You can make a function in Javascript to contact a PHP script on your server, however.

Upvotes: 2

Tom van der Woerdt
Tom van der Woerdt

Reputation: 29985

No. PHP only runs on the server, while the extensions run in the browser. You can, of course, contact your server, but you can't run PHP inside the browser.

Upvotes: 3

Related Questions