Comments (17)
Could you write steps to reproduce?
from electron-extensions.
Yes sorry. I'll edit my post.
from electron-extensions.
Please, show me your full code of the extension loading part. Do you execute it in app load
event?
from electron-extensions.
@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.
What isn't working in webRequest
?
from electron-extensions.
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.
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.
Any discoveries?
from electron-extensions.
@IceHacks Not yet. I will need to test it out.
from electron-extensions.
ok @sentialx if you need any more resources from me I should be able to get them.
from electron-extensions.
@IceHacks Could you create a repo to reproduce this (with manifest.json and all needed things to get it to run)?
from electron-extensions.
I'll see what I can do @sentialx
from electron-extensions.
@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.
Don't know if you saw this 😄 just for good measure. I know you are busy.
from electron-extensions.
I saw, thanks
from electron-extensions.
@IceHacks Is it fixed?
from electron-extensions.
No, but I found my own solution. It was probably just me doing something wrong.
from electron-extensions.
Related Issues (20)
- Skipping extension with invalid URL HOT 1
- Write tests
- adding crx HOT 2
- Tracking issue for Chrome APIs HOT 2
- objectToArray function mangles requestHeaders and responseHeaders HOT 1
- Does it work with content scripts that do not run in background page? HOT 4
- Question: Can we load extensions from Web Stor? HOT 1
- Status of electron 9 support HOT 1
- Known supported extensions HOT 2
- electron-extensions 7.0.0 HOT 4
- windows.create in background page HOT 1
- UnhandledPromiseRejectionWarning: TypeError: Cannot redefine property: webRequest
- Active loaded extension HOT 13
- Unable to load ublock origin HOT 4
- chrome.tabs.getSelected() should not return an array on 7.0.0-beta.2 HOT 1
- What does the License Mean? HOT 1
- How to properly open windows for browser Action popups HOT 11
- Support promise responses in WebRequest
- Cannot use import statement outside a module HOT 1
- Using PDF.JS as Chrome Extensions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from electron-extensions.