Skip to content

Commit

Permalink
mobile: fix clipper build output path
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarahm-ed committed Sep 22, 2023
1 parent 788429e commit 2592a90
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/mobile/native/ios/extension.bundle/clipper.bundle.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions extensions/web-clipper/src/content-scripts/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,22 @@ function clip(message: ClipMessage) {
const isScreenshot = message.mode === "screenshot";
const withStyles = message.mode === "complete" || isScreenshot;

if (config) {
config.styles = withStyles;
}

if (isScreenshot && message.area === "full-page") {
return clipScreenshot(document.body, "jpeg", config);
} else if (message.area === "full-page") {
return clipPage(document, withStyles, false, config);
return clipPage(document, false, config);
} else if (message.area === "selection") {
enterNodeSelectionMode(document, config).then((result) =>
browser.runtime.sendMessage({ type: "manual", data: result })
);
} else if (message.area === "article") {
return clipArticle(document, withStyles, config);
return clipArticle(document, config);
} else if (message.area === "visible") {
return clipPage(document, withStyles, true, config);
return clipPage(document, true, config);
}
} catch (e) {
console.error(e);
Expand Down
5 changes: 3 additions & 2 deletions packages/clipper/src/index.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { clipArticle } from "./index";
import { clipArticle, clipPage } from "./index";

declare module global {
var Clipper: any;
}

global.Clipper = {
clipArticle
clipArticle,
clipPage
};
5 changes: 4 additions & 1 deletion packages/clipper/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ module.exports = {
mode: "production",
output: {
filename: "clipper.bundle.js",
path: path.resolve(__dirname, "../../apps/mobile/native/ios")
path: path.resolve(
__dirname,
"../../apps/mobile/native/ios/extension.bundle"
)
}
};

0 comments on commit 2592a90

Please sign in to comment.