Coder Social home page Coder Social logo

Comments (17)

sentialx avatar sentialx commented on July 22, 2024

Could you write steps to reproduce?

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

Yes sorry. I'll edit my post.

from electron-extensions.

sentialx avatar sentialx commented on July 22, 2024

Please, show me your full code of the extension loading part. Do you execute it in app load event?

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

@sentialx I put it in the "ready" event. Which is (from what I read) where it goes.

...
const createWindow = async () => {
	var extension = new EE.ExtensibleSession(session.defaultSession);
	await extension.loadExtension(
		"path"
	);
	// Create the browser window.
	mainWindow = new BrowserWindow({
		width: 800,
		height: 600
	});

	mainWindow.loadURL("path");

	mainWindow.webContents.openDevTools();

	mainWindow.on("closed", () => {
		mainWindow = null;
	});
};
app.on("ready", createWindow);
...

from electron-extensions.

sentialx avatar sentialx commented on July 22, 2024

What isn't working in webRequest?

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

The background.js should block the loading of a file and replace it (using chrome.tabs.executeScript).

here is a sample:

"use strict";

chrome.webRequest.onBeforeRequest.addListener(
	function (details) {
		if (details.url.includes("something")) {
			inject();
			return { cancel: true };
		}
	},
	{
		urls: chrome.runtime.getManifest()["externally_connectable"].matches
	},
	["blocking"]
);

all the APIs should be supported

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

Wait a second. The thing that isn't working is not the blocking but another feature I am using. One sec. (I'll edit this)

I noticed that it was blocking the blocked files, but not redirecting the redirected ones.

EDIT:
It appears to be this part of the WebRequest on before request listener that isn't functioning:

...
if (redirect) {
	return {
		redirectUrl: chrome.runtime.getURL(fileName)
	};
}
...

Also, the blocking is working but the inject (using executeScript) is not.

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

Any discoveries?

from electron-extensions.

sentialx avatar sentialx commented on July 22, 2024

@IceHacks Not yet. I will need to test it out.

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

ok @sentialx if you need any more resources from me I should be able to get them.

from electron-extensions.

sentialx avatar sentialx commented on July 22, 2024

@IceHacks Could you create a repo to reproduce this (with manifest.json and all needed things to get it to run)?

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

I'll see what I can do @sentialx

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

@sentialx https://github.com/IceHacks/example-of-brokeness Just do npm i && npm start, the extension should not work. Then load the extension in chrome, it should work.

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

Don't know if you saw this 😄 just for good measure. I know you are busy.

from electron-extensions.

sentialx avatar sentialx commented on July 22, 2024

I saw, thanks

from electron-extensions.

sentialx avatar sentialx commented on July 22, 2024

@IceHacks Is it fixed?

from electron-extensions.

IceHacks avatar IceHacks commented on July 22, 2024

No, but I found my own solution. It was probably just me doing something wrong.

from electron-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.